CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6

Thread: CComboBox

  1. #1
    Join Date
    Dec 2005
    Posts
    445

    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

  2. #2
    Join Date
    Jan 2005
    Posts
    111

    Re: CComboBox

    Please declare the ComboBox as a member variable.

  3. #3
    Join Date
    Dec 2005
    Posts
    445

    Re: CComboBox

    Thanks!

    I moved it but it still don't work 8(

    Can anyone please help!!!

  4. #4
    Join Date
    Sep 2005
    Location
    London
    Posts
    208

    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

  5. #5
    Join Date
    May 2007
    Posts
    437

    Re: CComboBox

    Quote Originally Posted by Salvadoravi View Post
    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 Attached Files
    ashu
    always use code tag

  6. #6
    Join Date
    Dec 2005
    Posts
    445

    Re: CComboBox

    Quote Originally Posted by Doron Moraz View Post
    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
  •  





Click Here to Expand Forum to Full Width

Featured