combobox

How do I make the TAB key close a TComboBox without losing the current position?

I have a TComboBox on a form. Its Style property is set to csDropDownList. If I open the dropdown and select an option with my mouse or keyboard and hit ENTER, the dropdown box closes and the ItemIndex property is changed before the KeyPress event handler is fired. If I hit TAB, the dropdown doesn't disappear until after the KeyPress ...

tcl/tk widget combobox loses focus

The tcl/tk widget iwidgets::combobox with a terrible flaw: when the list goes away, the focus goes away from the gui so you can't type in entry boxes unless you move the mouse out of the gui and back in. This problem has been noted in other places, but I have not seen any solution. a. is there a way to re-gain focus before exiting the...

WPF: How to Disable Combobox Items?

Hi! Is there a way to disable all but the first x items of a WPF ComboBox by accessing its items' properties via an Index? edit: ComboBoxItem DiffieHellmanItem = (ComboBoxItem)comboboxName.ItemContainerGenerator.ContainerFromIndex(i)); works ...

How do I bind a Combo so the displaymember is concat of 2 fields of source datatable?

Id like to bind a combo to a datatable (which I cannot alter ito it original schema) cbo.DataSource = tbldata; cbo.DataTextField = "Name"; cbo.DataValueField = "GUID"; cbo.DataBind(); What I want to do, is have the combo textfield show tbldata.Name column + tbldata.Surname. Of course adding the new name+surname as a field to the tbld...

How to limit dropdown height for combo box in XAML

What should i do if I want to limit the dropdown height of my combo box to 7? MaxDropdownHeight produces different results for different OS (Operating System); In XP for instance, if I set MaxdropDownHeight to 98, I get desired result, but when I try to test in Vista, its different. How shall I do this when using ComboBox in System.Windo...

Winforms ComboBox Databind with DropDownStyle=Dropdown

Winforms / .Net 3.5 I am using a combobox with the dropdownstyle set to dropdown (allows users to enter data). The problem I am having is with how to setup the combobox so it updates my bindingsource with values from the list and also when a user enters data. For example the combobox may contain the following values: "Red", "White",...

How would I make a ComboBox that displays arbitrary content as part of the item template?

I need to create several combo boxes to represent enumeration values. I want the values to be represented with some graphical preview to the left and text to the right. The "preview" part of the display might be a control, an image, or some other content. I've tried two approaches and failed both, so I'm curious what some alternatives...

Binding files from ClientBin folder into a ComboBox in Silverlight?

Hello all, I was wondering if it was possible to bind some filenames in a given directory of the ClientBin folder to a ComboBox. I'm working on this application that has a video Tutorials section. I've got a comobox that lets the user select which tutorial video they wish to see. Right now not all the videos are completed (it's a bit...

How do I set a ComboBox default *not in the drop down* when a list item begins with the same text as a drop down item?

Using C#, say you have a ComboBox that has a DropDownStyle set to DropDown (there are items in the drop down but the user can manually enter a value as well). How do you set a default value for the ComboBox that is not in the list of values in the drop down, but begins with text from a possible selection? Normally setting ComboBox.Text w...

DropDown WPF GridView

How implement selectable GridView embedded in WPF ComboBox. ...

Flex Combobox strange problem

I am facing a strange problem with the combobox in Flex. In the following code : public function rollCombo(cmb:ComboBox,value:String):void { if(value=='') return; var i:int=0; cmb.selectedIndex = 0; var dp1:XMLListCollection = (XMLListCollection(cmb.dataProvider); trace(value); while(dp1[i]!=valu...

Filter subform using combobox

This has taken me nearly 2 weeks and I dont know what else to do. I have a main form (UserSearch) that has a subform (TestUserSub). The associated table for both forms is tblusers. very simple; on the main form (UserSearch) I have a comboboxes associated with the fields in the tblusers eg cmbid, cmbname, cmbdept and so on. All I want, is...

How can I force a DropDownList style ComboBox to only open when the user clicks the drop-down button?

In C# .NET 2.0, I have a WinForms ComboBox with ComboBoxStyle DropDownList. However, the drop down appears whenever the user clicks anywhere on the combo box. Instead, I'd like to have it only open when the user explicitly clicks on the drop down button. When the user clicks on the rest of the combo box, I'd like to just assign it the...

My databinding with value converter does not work

I've got a simple Item-class, that looks like this: public class Item : DependencyObject { public int No { get { return (int)GetValue(NoProperty); } set { SetValue(NoProperty, value); } } public string Name { get { return (string)GetValue(NameProperty); } set { SetValue(NameProperty, value); } } public static readonly D...

How do I Change comboBox.Text inside a comboBox.SelectedIndexChanged event?

Code example: private void comboBox_SelectedIndexChanged(object sender, EventArgs e) { if(some condition) { comboBox.Text = "new string" } } My problem is that the comboBox text always shows the selected index's string value and not the new string. Is the a way round this? ...

custom components with ColorPicker and ComboBox

Hi, I've a custom component with a ColorPicker and a ComboBox grouped using a ApplicationControlBar. This custom component is created at runtime using actionscript and added to the application (AIR application). When a button is clicked, this custom component is removed from the main application and added to a window to show it in a se...

Dynamically changing the text of items in a Winforms ComboBox

(Sorry I have not been a able to write a very clear question) I have a Winforms ComboBox that contains instances of a custom class. When the items are first added to the Items collection of the ComboBox box, the ToString() method is call on each of them. However when the user changes the language the application is running in, the res...

Show selected item in a DataGrid within a ComboBox

I have a WPF toolkit DataGrid as the dropdown in a ComboBox template. <toolkit:DataGrid x:Name="InnerGrid" ItemsSource="{TemplateBinding ItemsSource}" CanUserReorderColumns="False" CanUserResizeColumns="True" CanUserSortColumns="False" CanUserResizeRows="False" A...

C# Combo box value change, what Event should I use to write update the registry?

Hi all, I have a read only combo-box with 5 values in, when the user selects a new value what event should I use to write that value to the registry? Thanks ...

C# Setting combobox text when form loads

When my program loads I read a value from the registry and set a read only combo box to that value however when loaded the combobox shows the item before it in the collection. I'm using the code below to set the text. RegistryKey OurKey = Registry.CurrentUser; OurKey = OurKey.OpenSubKey("Software\\test",true); type = OurKey.GetValue("Ty...