RE: Form steals the focus irrespective of the Z Order in VB6
- From: Pradeep <Pradeep@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 28 Nov 2006 22:51:00 -0800
Hello,
I found out the root cause for the problem. The first control that receives
the focus is a text box. In its lost focus there is code which sets the focus
to the another control in the same form. So once I open this form, the focus
is set to the first control. Now when I open another form which causes the
control to lose focus and the lost focus event is fired. This event causes
the focus to be set to another control in the same form thus ensuting that
the form does not lose focus at all.
I commented the line of code in the lost focus of the first control and that
worked fine.
Thanks for your patience in case any one of are having a look at this problem.
Thanks,
Pradeep
"Pradeep" wrote:
Hello,.
I am in process of developing an MDI application using Vb6. There are menus
which invoke various forms. There is also a Window menu item which lists all
the open forms in a sequence. Now i am facing a peculiar problem. When the
menu item is clicked the code that runs behind it is in the form:
With FormName
.Show
. Zorder 0
End with
There is a form by name X. If i leave that and open all the others, they are
opening and getting listed in the windows menu from where i am able to
navigate to the desired form. Along with them if i open the X form, that too
gets listed in the window menu. But when I click any other form the focus
does not go to that form and remains with the form X.
Form X is retaining focus and all the forms opened are always behind the
form X.
Following are some of the properties set to the form:
MaxButton=True
MDIChild= True
MinButton= True
ShowInTaskbar = True
StartupPosition=0-Manual
WindowState - 2 Maximized
The above said properties in other forms are also the same and I am not able
to know why a particular form is retaining focus.
Thanks,
Pradeep
- References:
- Form steals the focus irrespective of the Z Order in VB6
- From: Pradeep
- Form steals the focus irrespective of the Z Order in VB6
- Prev by Date: Form steals the focus irrespective of the Z Order in VB6
- Next by Date: Re: How Big is Too Big?
- Previous by thread: Form steals the focus irrespective of the Z Order in VB6
- Next by thread: File Open Button
- Index(es):