J
Janez
Hi,
I have designed application with two forms. First form serves as main
form, the second form has several groupboxes and is always displayed
modally with corresponding groupbox visible(depends on which button
was clicked in the main form). When the form is displayed, the focus
is also set to the first control in the visible groupbox (focus is set
in the Activate event of the form that is displayed modally). But, I
have found that this approach is not good, because focus is also set
when application receives focus and the form is displayed in the
application.
For example, if user displays second form, focus is set to the first
control in the visible groupbox. If now user sets focus to the third
control, switches to other application and then back, the focus is set
to the first control again which is what I do not want (I just want to
set focus when form is shown from application). So, the Activate event
of the form is not good for this action, but I cannot find the way to
set focus only when displaying form. I have tried Load event, but
focus does not work.
Any idea?
Regards
Janez
I have designed application with two forms. First form serves as main
form, the second form has several groupboxes and is always displayed
modally with corresponding groupbox visible(depends on which button
was clicked in the main form). When the form is displayed, the focus
is also set to the first control in the visible groupbox (focus is set
in the Activate event of the form that is displayed modally). But, I
have found that this approach is not good, because focus is also set
when application receives focus and the form is displayed in the
application.
For example, if user displays second form, focus is set to the first
control in the visible groupbox. If now user sets focus to the third
control, switches to other application and then back, the focus is set
to the first control again which is what I do not want (I just want to
set focus when form is shown from application). So, the Activate event
of the form is not good for this action, but I cannot find the way to
set focus only when displaying form. I have tried Load event, but
focus does not work.
Any idea?
Regards
Janez