FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Want to set default selection idx of combobox in constructor

 
Post new topic   Reply to topic     Forum Index -> DFL
View previous topic :: View next topic  
Author Message
powder0326



Joined: 18 Mar 2009
Posts: 5

PostPosted: Wed Mar 18, 2009 11:41 am    Post subject: Want to set default selection idx of combobox in constructor Reply with quote

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
View user's profile Send private message
Chris Miller



Joined: 27 Mar 2004
Posts: 514
Location: The Internet

PostPosted: Wed Mar 18, 2009 7:55 pm    Post subject: set default selection idx of combobox in constructor Reply with quote

Same answer as this.
Back to top
View user's profile Send private message
powder0326



Joined: 18 Mar 2009
Posts: 5

PostPosted: Wed Mar 18, 2009 8:41 pm    Post subject: Reply with quote

It is this exactly. It did not notice. Thank you.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> DFL All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group