-
September 9th, 2013, 07:47 AM
#1
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.
-
September 9th, 2013, 08:40 AM
#2
Re: ComboBox Problem
Originally Posted by shjdr7
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.
Originally Posted by shjdr7
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
-
September 9th, 2013, 09:10 AM
#3
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?
-
September 9th, 2013, 09:24 AM
#4
Re: ComboBox Problem
Originally Posted by shjdr7
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?
-
September 9th, 2013, 09:33 AM
#5
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?
-
September 9th, 2013, 09:50 AM
#6
Re: ComboBox Problem
Victor Nijegorodov
-
September 9th, 2013, 10:34 AM
#7
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.
-
September 9th, 2013, 11:02 AM
#8
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?
-
September 9th, 2013, 11:24 AM
#9
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|