damirsel
asked on
Forms problem
Hello.
I have two forms:
Form1.borderstyle=FixedSin gle
Form2.borderstyle=FixedSin gle
Form2.ShowInTaskbar=False
form1 (main form) and form2 (settings form). When user click on form1.command1, then must show settings form. My problem is when I click on form1.command1 then:
Form2.Visible = True
Form1.Enabled = False
and then Form1 lost his focus from taskbar, so when I click on taskbar (form1) form2 hides (lost focus) behind disabled Form1, and only can be seen when I maximize and minimize some other apps window.
So I need a way to show Form2 and to keep Forms1 focus in taskbar, but Form1.Enabled must be FALSE
I tried with Form1_Activate(), Form1_GotFocus(), Form2_LostFocus() and nothing...
Thanks.
I have two forms:
Form1.borderstyle=FixedSin
Form2.borderstyle=FixedSin
Form2.ShowInTaskbar=False
form1 (main form) and form2 (settings form). When user click on form1.command1, then must show settings form. My problem is when I click on form1.command1 then:
Form2.Visible = True
Form1.Enabled = False
and then Form1 lost his focus from taskbar, so when I click on taskbar (form1) form2 hides (lost focus) behind disabled Form1, and only can be seen when I maximize and minimize some other apps window.
So I need a way to show Form2 and to keep Forms1 focus in taskbar, but Form1.Enabled must be FALSE
I tried with Form1_Activate(), Form1_GotFocus(), Form2_LostFocus() and nothing...
Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You might try a Form2_LostFocus event to set Form1's focus
Private Sub Form2_LostFocus()
Form2.hide 'or unload Form2
Form1.SetFocus
End sub
Private Sub Form2_LostFocus()
Form2.hide 'or unload Form2
Form1.SetFocus
End sub
ASKER