December 24th, 2008, 04:56 AM
#1
CComboBox
Hi all,
How can I create a combo box on runtime ?
I've tried:
Code:
BOOL CMyDlg::OnInitDialog()
{
CDialog::OnInitDialog();
CComboBox ComboBox;
ComboBox.Create( 0, CRect(10, 10, 100, 200), this, 0 );
return TRUE;
}
It didn't work 8(
Many thanks for your help
December 24th, 2008, 05:35 AM
#2
Re: CComboBox
Please declare the ComboBox as a member variable.
December 24th, 2008, 05:43 AM
#3
Re: CComboBox
Thanks!
I moved it but it still don't work 8(
Can anyone please help!!!
December 24th, 2008, 05:53 AM
#4
Re: CComboBox
Hi Salvador,
Code:
ComboBox.Create( WS_CHILD|WS_VISIBLE|WS_VSCROLL|CBS_DROPDOWNLIST, CRect(10, 10, 200, 100), this, 1 );
That should do it.
Regards
Doron Moraz
December 24th, 2008, 05:55 AM
#5
Re: CComboBox
Originally Posted by
Salvadoravi
Thanks!
I moved it but it still don't work 8(
Can anyone please help!!!
Please look on the attached project.
*project has created only combo box.
Attached Files
December 24th, 2008, 06:00 AM
#6
Re: CComboBox
Originally Posted by
Doron Moraz
Hi Salvador,
Code:
ComboBox.Create( WS_CHILD|WS_VISIBLE|WS_VSCROLL|CBS_DROPDOWNLIST, CRect(10, 10, 200, 100), this, 1 );
That should do it.
Regards
Doron Moraz
THANK YOU !!!! It's finally working!!!
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