CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 9 of 9
  1. #1
    Join Date
    Aug 2013
    Posts
    52

    Unhappy ComboBox Problem

    I observed the following problems
    1)InitCommonControlsEx with ICC_STANDARD_CLASSES returns FALSE
    2)So I used ComboboxEx. Then ::SendMessage(m_hWnd, CB_SETMINVISIBLE, 10, 0L); is returning false.
    I already clalled InitCommonControlsEx with ICC_USEREX_CLASSES


    Hint: I am using windows7,ATL&WTL

    Any help please.

    ::SendMessage(m_hWnd, CB_SETMINVISIBLE, 10, 0L); failed because "it doesn't have edit control?".
    When I click on the combobox icon only one item is appearing in the drop down list box .I have added two items.What I should do to show list box with 2 items min?
    Last edited by shjdr7; September 9th, 2013 at 08:03 AM.

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: ComboBox Problem

    Quote Originally Posted by shjdr7 View Post
    I observed the following problems
    1)InitCommonControlsEx with ICC_STANDARD_CLASSES returns FALSE
    2)So I used ComboboxEx. Then ::SendMessage(m_hWnd, CB_SETMINVISIBLE, 10, 0L); is returning false.
    From MSDN:
    CB_SETMINVISIBLE message

    An application sends a CB_SETMINVISIBLE message to set the minimum number of visible items in the drop-down list of a combo box.
    Parameters
    ...
    Return value
    If the message is successful, the return value is TRUE. Otherwise the return value is FALSE.
    Remarks
    When the number of items in the drop-down list is greater than the minimum, the combo box uses a scroll bar. By default, 30 is the minimum number of visible items.
    This message is ignored if the combo box control has style CBS_NOINTEGRALHEIGHT.

    To use CB_SETMINVISIBLE, the application must specify comctl32.dll version 6 in the manifest. For more information, see Enabling Visual Styles.
    Quote Originally Posted by shjdr7 View Post
    When I click on the combobox icon only one item is appearing in the drop down list box .I have added two items.What I should do to show list box with 2 items min?
    Open resource editor, click on the combobox "arrow" and then increase the height of the dropped down listbox.
    Victor Nijegorodov

  3. #3
    Join Date
    Aug 2013
    Posts
    52

    Re: ComboBox Problem

    Victor sir. In the resource editor it is not possible to edit the height of drop down list box of the comboboxex. Is it that I have to add an xml manifest file just for adding a combobox? It would be easier to use an activex control.
    What do you recommend?

  4. #4
    GCDEF is offline Elite Member Power Poster
    Join Date
    Nov 2003
    Location
    Florida
    Posts
    12,635

    Re: ComboBox Problem

    Quote Originally Posted by shjdr7 View Post
    Victor sir. In the resource editor it is not possible to edit the height of drop down list box of the comboboxex. Is it that I have to add an xml manifest file just for adding a combobox? It would be easier to use an activex control.
    What do you recommend?
    Did you click on the arrow on the combo box?

  5. #5
    Join Date
    Aug 2013
    Posts
    52

    Re: ComboBox Problem

    Yes sir.I am using Visual Studio 2008. Higher version is required to do like that?
    Still why not possible through code?

  6. #6
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: ComboBox Problem

    Victor Nijegorodov

  7. #7
    Join Date
    Aug 2013
    Posts
    52

    Re: ComboBox Problem

    Yes. It is working!Maybe CBS_NOINTEGRALHEIGHT style is set by default. I will try through code also
    after removing the style and will be back after sometime.

  8. #8
    Join Date
    Aug 2013
    Posts
    52

    Re: ComboBox Problem

    My problem is over. But my curiosity doesn't stop. How to remove the CBS_NOINTEGRALHEIGHT style.
    I tried like this
    CComboBoxExT<Window> wnd = GetDlgItem(IDC_COMBOEX1);//WTL class
    1)BOOL b = wnd.ModifyStyle(CBS_NOINTEGRALHEIGHT,0);//returned FALSE
    2)BOOL b = wnd.ModifyStyleEx(CBS_NOINTEGRALHEIGHT,0);//returned FALSE
    3)BOOL b = wnd.SetExtendedStyle(CBS_NOINTEGRALHEIGHT,0);//returned FALSE

    Any idea?

  9. #9
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: ComboBox Problem

    Do it in the resource editor in design time.
    Some combobox (and other controls too!) properties/styles are impossible to change after control has been created.
    Victor Nijegorodov

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