I have an msoControlComboBox item in an Outlook 2007 command bar. I am able to add items to the combo box dropdown, and if the user types something in the textbox that matches the beginning of any words in the dropdown, then the combobox suggests the rest of the word, inside the text box.
I would like to do a little better than that.
I would like to be able to detect keypress events, and add/remove items from the dropdown list based on the characters the user has entered so far.
I would also like to be able to dropdown the list programatically (right now the only to drop it down appears for the user to click on the dropdown arrow).
Is there a way to accomplish these two objectives (in c#).
There is no out of the box microsoft control that can do it.
You aren't the first person to want this however and I personally used a control found here and found it to be a good starting point for my needs. It's aimed at finding in email addresses but it can be adapted to other needs. It uses regexp searches to find matches
Related
In a wxpython Combobox, long strings get left-truncated in the dropdown portion. This can result in some values looking identical when they aren't. I'd like to provide better information to the user than that.
The following options occur to me:
Insert elipses in the middle of the string before adding it to the combobox's dropdown choices and expanding it back before placing back in the edit portion.
Show a tooltip of the full string when the user mouses/hovers over a value in the dropdown.
Problem is, the Combobox class does not expose events that enable either of the above.
How can I intercept the events corresponding to either of the above? Any other ideas for making long combobox strings visible to the user?
Thanks,
RichK
I would recommend using the ComboCtrl instead of the ComboBox. The benefit is that the ComboCtrl is a custom widget, so it allows more flexibility. For example, the ComboCtrl provides a scrollbar for long strings. Check out the wxPython demo for some good examples.
I'm a novice in programming and I'm seeking advice on my program in visual basic (visual studio 2010).
I'll describe my aims of the program and how I've created a mock up.
My main interface will have several tabs. Within each tab, there will consist of a few textboxes for entering data and a few checkedlistboxes with a list of items in each of them.
What I'd like to do is to gather all the information inputted and/or clicked by a user of the program and to assimilate the information to a pre-formatted text box, that will give me the option to output it to a file. I'd like the pre-formatted textbox to gather the data from the different textboxes and checkedlistboxes from the various tabs. I can give an example (non-code) of what I mean:
Tab 1 of application:
textbox asking for name
textbox asking for date
checkedlistbox with items ("green", "blue", "red")
Tab 2 of application:
textbox asking for name of country
textbox asking for citizenship
checkedlistbox with items ("north", "south", "east", "west")
Tab 3 of application:
textbox that is "preformatted" to grab the data from the first two tabs so that I can save it to a textfile that would look like this
My name is Billy
Today's date is 31JAN2010.
I like: green blue red,
I come from United States of America.
I am American.
I am from the region of South
As of now, the method I'm using is largely inefficient. I'm just not knowledgable enough yet to do what I want do I've resorted to this strategy:
For checkedlistitems, I output the list of items to a textbox. I make this box invisible to the user. I then call this box in my tab 3, which has a button and text area. The button portion automatically codes the "preformatted" text and its a matter of referencing the invisible textbox which contains the item lists that were checked. One problem with this, or how I've programmed the checkedlist box, is that If I check something, and then uncheck it, it still appears in my tab 3 textbox.
For example, If I was a user using the 2nd tab and I clicked "South" but then unclick it and click "North", the textbox says
I am from the region of South North
I'm not sure which property or where in my code I need to alter so that it can remove items. I'm using a for loop to grab the items and don't have my code on hand.
In general, I'm just looking for strategies for programming something like this that will be efficient compared to what I have. Any suggestions / examples / code is well appreciated.
For your checkedlistbox, you can use the even SelectedIndexChanged that way when you change the selection, you won't have that problem:
example of how to use:
If you have a simple label for example :
Label1.Text = "I am from the region of " & checkedlistbox1.selecteditem.value
Btw in your case I don't think a for loop is necessary.
If you wish for information try w3schools or msdn.
Regards
I have an editable combo-box where the user could select (or type) one of the values from the drop-down, or a different value altogether.
I need the autocomplete functionality, which is essentially showing a subset of values in the drop-down when one or more characters are entered.
I see there is an autocompletemode property in system.windows.forms.combobox, which would have probably served my purpose but, is there an equivalent in WPF system.windows.controls.combobox?
The WPF Toolkit Autocomplete Box is what you need. This tutorial should get you started.
The idea is rather simple. Some datawindow (not web datawindow) varchar fields contain detailed descriptions. I was wondering if it is possible to provide the following (wikipedia-like) functionality to users: The ability to click (or dbl-click or whatever) on specific words of the text, while reading (which somehow should be indicated as clickable - it would be perfect if they could be colored blue but I don't think this is possible) and open a relevant window (or response). Do you think something like this could be implemented?
To achieve the colour, you could use a rich text edit style if you're using PB 11.5.
For the hyperlink functionality, I'd try to leverage the Clicked event, trying to identify with SelectedStart() what word has been clicked and then whether or not it is a hyperlink. The column would need to have TabOrder so that a click would place the cursor in the text.
Good luck,
Terry.
if you use a RTF datawindow you can insert hyperlinks (in whatever colour or style you wish)
I have a list that the user can filter in several ways. two of which lend themselves to combo boxes and two that need to accept user input. For example, one textbox allows the user to type in any part of a list item's description, and the dialog will only present items whose description contains the text entered.
It is a dialog 'picker' type of window, so space is at a premium. I'd like for the text boxes not to require a traditional label. Instead, when the dialog is first invoked, the label (ie, "Description") is grayed out, centered, and in italics. Maybe a tool tip to further make it obvious to the user what it's for. When the user starts to type, the faux label disappears and the entered text is normal left aligned text.
Does wpf / silverlight have any native support for doing something like this? I guess it could be a combination of styles and eventing. I'd rather not invent any wheels that might be out there (I got the idea specifically from looking at Tortoise' "Show Log" window, but I've seen it before).
Does anyone have any sample code they can share to do this? Or a an alternative idea that also saves space and simplifies the layout?
Cheers,
Berryl
Kevin Moore's InfoTextBox, which is part of his Bag-O-Tricks is the kind of thing I was looking for, almost exactly. This is also the 'watermark' (great name - I would have found this sooner if I had known that) text box from another post.