Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
deactivate case CBN_SELCHANGE on reset of CB item
#1
Hi All,

I have a dialog with a Combo box. The CB box usually displays the last chosen item, which triggers certain actions via a
Code:
Copy      Help
case CBN_SELCHANGE
statement int he dialog. But I need to on a regular basis "reset" the combo box field to a blank or a certain item. I can do this easily with a
Code:
Copy      Help
CB_SelectItem
function but this triggers the CBN_SELCHANGE

Is there any easy way to disable CBN_SELCHANGE when the CB item is changed via CB_SelectItem. Currently I have a global variable that I set to 1 at the time of the condition that requires a reset (i.e. change in document being evaluated). In the macro being triggered, there is a line that checks if the global variable is 1, if so it changes it back to 0 and returns.

This works fine but it seems roundabout and I am always looking for ways to cut down on the number of global variables I am using.

Any ideas?

Stuart
#2
SendMessage(hwndctrl CB_SETCURSEL itemindex 0)

CB_Select also sends WM_COMMAND to the parent window.


Forum Jump:


Users browsing this thread: 1 Guest(s)