I'm not sure I follow correctly but can't you just ensure that there's always a selection in the combo box? In other words, when the combo is first displayed (perhaps in the dialogs 'OnInitDialog()' function) use the combo's 'SetCurSel()' function to ensure a selection is already made. That way, there is no way the user can 'OK' the dialog without a selection being made from the combo.
Actually I need to start with a reason not chosen. There really isn't any appropriate default selection.
I can disable other dialog objects (buttons, grid, etc.) and wait for the user to select a reason before reactivating the other items. I can also trap for the user attempting to focus on other elements of the dialog.
I was just hoping that there were a simpler method to focus on the combobox and force the user to stay there until a selection was made.
you can set the focus on that combobox and if the user attempts to lose focus on that combobox you can have some trap to check if the combobox has data.
I don't rmeember if there was a way to set something to reply on un focus (but I'm sure there is)... But anyways - a decent work around would be to check when on focus of other controls, it will check and reset control to the combobox should it not be filled out.
The simplest explanation is usually the best. If I was faced with this problem, I would check to see whether the user had made a valid selection in the combo before dismissing the dialog when the user clicks 'OK'. If not, don't dismiss it and display some kind of error message box instead saying they need to make a valid selection from the combo before continuing.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.