Questions tagged [ccombobox]

CComboBox class provides the functionality of a Windows combo box.

CComboBox class provides the functionality of a Windows combo box.

55 questions
9
votes
2 answers

Catching when user selects an item from a CComboBox

This is as basic as it gets. I want to catch when the user selects an item from a CComboBox (actually, a subclass of CComboBox). Tried lots of combinations of OnCblSelChange, OnCommand. Guess I haven't hit the right combo yet (no pun intended). OS…
Lou
6
votes
3 answers

How do I create an MFC ComboBox with search

I need a combobox in an Windows MFC application that has a search feature. It should work so that if you start typing something that matches one or more items in the list, the combobox should drop-down and display those items. Kinda like popular…
jonsb
  • 2,016
  • 3
  • 21
  • 24
5
votes
1 answer

In MFC, how do I tell if a CComboBox is enabled?

I see that you can enable/disable using the EnableWindow method, but how do I get it's current state?
bsh152s
  • 3,178
  • 6
  • 51
  • 77
4
votes
1 answer

CComboBox not selecting CurSel when dropped down

I have an alphabetically sorted combobox in a dialog. This combo contains multiple strings, but some are duplicated with different cases. i.e. we have an 'On' and an 'ON', an 'Off' and an 'OFF'. This may seem redundant but there is a reason,…
ChrisJ
  • 181
  • 14
3
votes
1 answer

CComboBox::Dir function does not list directory if Archive attribute is unset and Index attribute is set

I am using CComboBox::Dir(DDL_READWRITE, path) to populate the contents of a combobox. Everything is fine, but when I reset the Archive flag and set the Index flag, the Dir() returns no files. I am using attrib -A *.* attrib +I *.* in the directory…
goto
  • 433
  • 3
  • 13
3
votes
2 answers

Get text from CComboBox

I have a CDialog (myDialogBox) that has a CComboBox member (myComboBox). My goal is to get the user-typed text (preferably as a CString) from the edit portion of a dropdown style CComboBox. But, I cannot seem to get it to work. I've tried using…
JHowzer
  • 3,684
  • 4
  • 30
  • 36
2
votes
1 answer

How to prevent the mouse cursor from being hidden after calling CComboBox::ShowDropDown?

In my MFC application, when I call CComboBox::ShowDropDown(), the mouse cursor is hidden until interaction with the combo box completes (when the combo box loses focus.) It doesn't reappear when the mouse is moved, like it does with edit boxes. How…
Aidan Ryan
  • 11,389
  • 13
  • 54
  • 86
2
votes
1 answer

How to get WPF combobox display text using UIAutomation?

I just started using UIAutomation for some testing. I got the most stuff working except this seemly simple one. I want to verify the localized text displayed in a combobox, but I couldn't figure out how to retrieve the (localized) display text…
newman
  • 6,841
  • 21
  • 79
  • 126
2
votes
1 answer

CCombobox : how to set text color of Editable area text when combobox style is dropdown in win32

I am using CComboBox with style DropDown wherein user can enter data in edit area in case expected option is not available in the drop down options. I am trying to set color of text present in Editable area using OnCtlColor but it sets color to only…
suprit
  • 79
  • 7
2
votes
0 answers

How to show drop-down list when set focus in ComboBox edit?

I want to implement auto-complete in ComboBox. As the first step, when a user clicks on the edit box and before typing anything, it should show the drop-down list with all available choices. void ...::OnCbnSetfocus() { if (!GetDroppedState()) …
user180574
  • 5,681
  • 13
  • 53
  • 94
2
votes
0 answers

Setting specific CComboBoxEx (Extended combobox) items to bold with text colour

I have a CComboBoxEx that displays some images and talk numbers: How can the text of specific combo items properties? Set font to bold. Set font colour. I know that for CComboBox I can make it owner draw and create the font and render the combo…
Andrew Truckle
  • 17,769
  • 16
  • 66
  • 164
2
votes
2 answers

Detect keyboard hotkey inside edit control of CComboBox

I have this code: BOOL CChristianLifeMinistryStudentMaterialDlg::PreTranslateMessage(MSG* pMsg) { BOOL bNoDispatch, bDealtWith; bDealtWith = FALSE; if (IsCTRLpressed() && pMsg->message == WM_KEYDOWN && pMsg->wParam ==…
Andrew Truckle
  • 17,769
  • 16
  • 66
  • 164
2
votes
0 answers

Set height of edit box/static text area of MFC CComboBox (not the dropdown)

My goal is to be able to programatically control the width and height of the combobox when it is closed (dropdown not displayed). I have various other controls, such as buttons, and I want all the controls to appear a uniform size on the dialog…
MPW
  • 329
  • 2
  • 13
2
votes
1 answer

How to Set the Width of CCombo Box drop down

I am using a class that is the descendant of CCombo Box. How can I set the maximum allowable width of its drop down list? What I concluded from internet surfing is that there is no such method in CCombo Box class. Someone please help me in this…
Itban Saeed
  • 1,660
  • 5
  • 25
  • 38
2
votes
3 answers

CComboBox Sorting

So I am attempting to cut my CPP teeth on an existing application. I ran into a bit of a snag. My combobox items are being added in order as you can see below. However, the output is [1,10,11,12,13,14,15,2,3,4,5,6,7,8,9] I have looked at the…
DotNetRussell
  • 9,716
  • 10
  • 56
  • 111
1
2 3 4