|
-
May 12th, 1999, 02:14 PM
#1
How to create ComboBox dynamically???
Hi,
I try to create a CComboBox dynamically without using the ressource editeur like this:
r2.bottom = 30;
r2.left = 10;
r2.right = 150;
r2.top = 10;
pNewComboBox = new CMyComboBox;
pNewComboBox->Create(WS_VISIBLE|CBS_DROPDOWNLIST,r,AfxGetMainWnd(),5003);
pNewComboBox->AddString("A");
pNewComboBox->AddString("B");
pNewComboBox->AddString("C");
But at runtime, I try to see the list(A,B,C), it doesn't work,
I can't see the list because the dropdown list is the same size
than the ComboBox. How can I set the size of dropdowm list?
or How can i set the combobox correctely?
Thanks
-
May 13th, 1999, 07:45 AM
#2
Re: How to create ComboBox dynamically???
Hi,
the rectangle you pass to the Create-function specifies the size of dropdown list. If you want to set the combobox size use the member-function SetItemHeight of CComboBox.
For example
pNewComboBox->SetItemHeight(-1,15);
sets the height of the closed combobox.
Hope i gave you the needed informations.
Good Luck!
Peter
P.S.: You initialized a variable called r2. But in function call you called it r.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|