Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Conflict in Setfocus with ZOrder

Status
Not open for further replies.

reyboysapphire84

Programmer
Apr 29, 2010
2
0
0
PH
I have a module named: MGlobals in here i declare a variable

General Declarations

Option Explicit
Public g_FocusMe As Boolean

then I have a MDIParent Named: mdiMMC here i declare the code:
-------------------------------------------------
Private Sub MDIForm_Activate()

If g_FocusMe = True Then
On Error Resume Next
frmMMCModuleNavigator.tvwssMenu.SetFocus
g_FocusMe = False
End If

End Sub
------------------------------------------------
Private Sub MDIForm_Deactivate()
g_FocusMe = True
End Sub
------------------------------------------------

Then I have a form named: frmMMCModuleNavigator

Private Sub tvwssMenu_DblClick()
Form1.Show
End Sub

This module navigator have a treeview that has a list of forms that when you lick the list, the MDIChild would appear.

Then in my MDI Child I declare the code:

Private Sub Form_Activate()
g_FocusMe = False
Me.ZOrder 0
End Sub
------------------------------------------------
Private Sub Form_Load()
g_FocusMe = False
End Sub
------------------------------------------------

When I click the form it would appear and the focus of the cursor is on the form, then i would click another form from the module navigator it would appear also but when I go back from the previously access form the cursor did not focus on that form but instead it focuses on the module navigator form. Please help me on this.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top