I am adding a DomainUpdown control as well as its list of items to display programmatically. I’ve also done it using the toolbox with the same results.
Here is some sample code that illustrates the behavior:
public Form1()
{
InitializeComponent();
GroupBox groupbox1 = new GroupBox();
this.Controls.Add(groupbox1);
DomainUpDown dup = new DomainUpDown();
dup.Items.Add("one");
dup.Items.Add("two");
dup.Items.Add("three");
dup.Wrap = true;
dup.Text = "two";
groupbox1.Controls.Add(dup);
}
When I run the program and click the up arrow, nothing happens. The only way to get the control to begin working is to click the down arrow. Once that has happened the control works as advertised.
Any ideas on why this might happen?
Try it like this:
By setting the index instead of the Text property, the up down buttons can properly move to the appropriate index in the list.