Home > Software engineering >  VB6 is compiled how MDI form under the main form of all child
VB6 is compiled how MDI form under the main form of all child

Time:09-19

To achieve the following functions, VB6 can support this function:
An MDI main forms below already open more child form: frm1, frm2 frm3,...
When again click menus, each menu item corresponding to a child form), if the child form before loaded, activates the child form, if the child form didn't load will open the child form,

CodePudding user response:

Current situation is: many child form had already click open, and then click on the menu to open the corresponding form, if the word form already open, will not be able to activate the current state, this leads to the sense that gives a user is: point this menu how did not respond, a closer look at the original already open this form again, if child form a lot of points is not human,

So the idea of having such requirements: when clicking the menu again, program traverse all open a form, if traversal found only need to activate the form to the current status is ok,

CodePudding user response:

This don't need you to write code, you will manage a menu,

CodePudding user response:

refer to the second floor vansoft response:
this don't need you to write code, he would have a menu management,

Have the function of automatic switching the default menu?
My situation is the occasional automatically, most of the situation is not automatically switch, do not know why?

CodePudding user response:

 Private Sub Menu1_Click () 
Dim FRM As Form
Dim flag As Boolean
Flag=False
For Each FRM Forms In
If FRM. Name="BSetting" Then
FRM. SetFocus
Flag=True
The Exit For
End the If
Next
If flag=False Then
Dim cs As New BSetting
Cs. WindowState=2
Cs. Show
End the If
End Sub

CodePudding user response:

I think was not especially complex, real in the Click event of the menu to frm1 form plus SetFocus method can
 
Private Sub cdmc_Click ()
Frm1. Show
Frm1. SetFocus
End Sub

SetFocus is to let it get focus, when open multiple MDI child window, click on the menu can be a child of the form to the front,

CodePudding user response:

For Each FM Forms In

Next
  • Related