View previous topic :: View next topic |
Author |
Message |
powder0326
Joined: 18 Mar 2009 Posts: 5
|
Posted: Wed Mar 18, 2009 11:41 am Post subject: Want to set default selection idx of combobox in constructor |
|
|
Code: |
import dfl.all;
class Test: dfl.form.Form
{
dfl.combobox.ComboBox comboBox1;
this()
{
text = "Test";
clientSize = dfl.all.Size(292, 273);
comboBox1 = new dfl.combobox.ComboBox();
comboBox1.name = "comboBox1";
comboBox1.bounds = dfl.all.Rect(112, 136, 120, 22);
comboBox1.parent = this;
comboBox1.items.add("1");
comboBox1.items.add("2");
comboBox1.items.add("3");
comboBox1.selectedIndex = 0; // it doesn't work!
}
}
int main()
{
Application.run(new Test());
return 0;
}
|
When the form was generated despite the expectation, the item '1' of the combo box was not selected.
How to work it at the same time as making form? |
|
Back to top |
|
|
Chris Miller
Joined: 27 Mar 2004 Posts: 514 Location: The Internet
|
Posted: Wed Mar 18, 2009 7:55 pm Post subject: set default selection idx of combobox in constructor |
|
|
Same answer as this. |
|
Back to top |
|
|
powder0326
Joined: 18 Mar 2009 Posts: 5
|
Posted: Wed Mar 18, 2009 8:41 pm Post subject: |
|
|
It is this exactly. It did not notice. Thank you. |
|
Back to top |
|
|
|