OpenDCL Forums

OpenDCL => Studio/Dialog Editor => Topic started by: Marco Jacinto on September 25, 2007, 07:38:31 AM

Title: Focus remains in combobox - modeless Dialog
Post by: Marco Jacinto on September 25, 2007, 07:38:31 AM
I have a modeless dialog with two controls, a combobox and a Graphicbutton, when I press the button, the focus passes to drawing screen, but when I do the same with the combo, the focus remains in the control. I have the EventInvoke property equal in both controls (1), I try changing this value to 1 or 0 with no success, I try changing this value in the form also.

So my question is:
How can I send the focus to the drawing area when I select an item in the combobox?

TIA

Saludos
Marco Jacinto
Title: Re: Focus remains in combobox - modeless Dialog
Post by: owenwengerd on September 25, 2007, 07:56:22 AM
Quote from: Marco Jacinto on September 25, 2007, 07:38:31 AM
...when I press the button, the focus passes to drawing screen, but when I do the same with the combo, the focus remains in the control.

Controls that can accept keyboard input do not automatically hand focus back to AutoCAD when the mouse leaves the form, otherwise it would be difficult to enter keyboard input for those controls. In the case of combo boxes, you could try handling the OnSelChanged event and set focus back to AutoCAD in that event handler by calling the (dcl_SetCmdBarFocus) function.
Title: Re: Focus remains in combobox - modeless Dialog
Post by: Marco Jacinto on September 25, 2007, 10:41:19 AM
thanks Owen, your suggestion solves the problem.

Saludos
Marco Jacinto