01-19-2009, 09:07 PM
Hi,
I have selections from a ComboBox filling a ListBox:
The problem is that mousewheel Up and Down and PgUp andPgDown and Home and End also cause CBN_SelChange to be triggered.
The only thing I want triggered a selection from the ComboBox to the ListBox is:
a) Selecting a CB item by the pulldown list: (as above) OR
b) Hitting OK with what is typed in the CB field (or autocompleted with CB_AutoComplete). This works with
I tried changing some of the styles on the CB but no success in blocking those otherways of triggering CBN_SELCHANGE.
For reference for others who might be confused about the different CBN styles available in the dialog editor, I found this reference:
http://articles.techrepublic.com.com/510...76690.html
Thanks, Stuart
I have selections from a ComboBox filling a ListBox:
,case CBN_SELCHANGE<<16|23
,,str SelectedCustomTag
,,if(CB_SelectedItem(id(23 hDlg) SelectedCustomTag) >= 0)
,,,LB_Add id(6 hDlg) SelectedCustomTag
The problem is that mousewheel Up and Down and PgUp andPgDown and Home and End also cause CBN_SelChange to be triggered.
The only thing I want triggered a selection from the ComboBox to the ListBox is:
a) Selecting a CB item by the pulldown list: (as above) OR
b) Hitting OK with what is typed in the CB field (or autocompleted with CB_AutoComplete). This works with
sel wParam
,case IDOK
,,ifa(id(1001 hDlg));;if cursor is in CustomTag Pulldown
,,,str GetCustomTagField.getwintext(id(23 hDlg))
,,,LB_Add id(6 hDlg) GetCustomTagField
,,,ret
,,ret;;prevents the dialog being closed on Return/Enter
I tried changing some of the styles on the CB but no success in blocking those otherways of triggering CBN_SELCHANGE.
For reference for others who might be confused about the different CBN styles available in the dialog editor, I found this reference:
http://articles.techrepublic.com.com/510...76690.html
Quote:Doing it with style
By default, a ComboBox control's Style property is set to vbComboDropDown (value = 0). This is the default style because it results in a ComboBox that works the way programmers usually want it to work. The control displays as a single-line text box with a down arrow at the right side. The user can type directly into the control or, by clicking the arrow, can select from the predefined items that have been loaded into the control. This style saves screen real estate because the list of items is hidden until the user clicks the arrow.
Setting the Style property to vbComboSimple (value = 1) results in a control that looks like a text box above a list box. As with the default style, the user can type in the text box or select from the list. The advantage is that the list always makes the available choices visible to the user. The disadvantage is that the control takes up more room on the screen.
The third ComboBox style is vbComboDrop-DownList (value = 2). When you select this style, theComboBox displays the same way as with the default style (i.e., a single-line text box with a down arrow at the right side). The variation is in the behavior; the user cannot type data into the control--he or she must select from the list. In other words, a ComboBox with the Style property set to vbComboDrop-DownList looks like a ComboBox but acts like a ListBox.
Thanks, Stuart