May I know how to adjust the combo box height?
I can adjust the combo box width and also the dropdown list height but not the combo box height.
See attachment combobox.jpg/
I found that the function combo box SetItemHeight(); with the index -1 can set the height of combo box. But after setting the height, I found that the font size still remain the same. How can I change the font size in a combo box?
I found that the function combo box SetItemHeight(); with the index -1 can set the height of combo box. But after setting the height, I found that the font size still remain the same. How can I change the font size in a combo box?
You can change the droplist height in the resource editor. Just click the arrow and size it how you want it.
You'd want to use Class Wizard to attach a CComboBox object to your dialog's combo box. cCombo is just a random combo box that has nothing to do with your control. Here's an article talking about a CStatic, but it's the same principle with a CComboxBox.
is it possible to set the width of vertical scroll bar of a combo box?
Not that I am aware of as the width of a vertical scroll bar is a system-wide defined constant. Use
Code:
GetSystemMetrics(SM_CXVSCROLL);
to obtain the value.
Why do you want to do this? What you can do is change the width of the drop-down list box to be different to the width of the edit box.
All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!
There are generally two types of controls in Windows: standard controls and custom controls. Custom controls are pretty customizable by design. Combobox is a standard control, so it's not that easy to change its looks. Well, standard means standard, and you know, I think keeping it looking standard (i.e. following OS's UI/UX guidelines) means you respect your end users first of all.
The reason I want to increase the width is because I am using a touch screen monitor so want to create a wider scroll bar so that user easy to click on it.
Anyway, thanks all for the advise.
I guess combo box is a standard controls.
if you want to do this, probably the way to do it would be to create your own custom control that looked like the standard control but with a resizeable scroll bar.
All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!
All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.