Link to home
Start Free TrialLog in
Avatar of Sling_Blade
Sling_BladeFlag for New Zealand

asked on

Control Not Losing Focus When Form Clicked

Hi,

I have several controls on my form (comboboxes and text boxes).

when I select a value from my combobox it will retain focus until I click into another control (by design).

The trouble with that is, if someone just clicks somewhere on the form itself the combobox still retains focus. If they then move the wheel button while the combobox has focus their selection in the combobox will change.

What I need to happen is for the combobox to lose focus as soon as the form OR any other control is clicked.

I have tried the myForm.ActiveForm.Focus() methood in the myForm_click event and it is not working for me.

I can get the focus event to fire for the other controls during the myForm_click event. However, I don't really want to arbitrarily force focus onto another control until the users chooses that control. What I really like to do is just remove focus from the combobox so the user doesn't accidentally choose the wrong item.

Is there a way I can force focus onto the form?
ASKER CERTIFIED SOLUTION
Avatar of rfgkev
rfgkev

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Sling_Blade

ASKER

Thanks for letting me know.

I will keep the question around a bit more to see if any one else wants to add anything.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks to rfgkev for the technical answer and to Sancler for a work around, good team work!