i work with 3 more form. 2 form has no border. when i click a button a form is show. when i minimize main form the other form still show. but i want when i minimized main form all from will minimize what was open.

Hi,
Form has WindowState Property.
The values may be
vbNormal - 0 - (Default) Normal.
vbMinimized - 1 - Minimized (minimized to an icon)
vbMaximized - 2 - Maximized (enlarged to maximum size)

But Form does not have any particular Event occur when minimize and maximize.

Resize() event can be useful
To do
> Check whether the form is already minimized or not
> Change the State to Minimized

Ex

Private Sub Form_Resize()
   If Form1.WindowState = vbMinimized Then
      OtherForm.WindowState = vbMinimized
   End If
   If Form1.WindowState = vbNormal Then
      OtherForm.WindowState = vbNormal
   End If
End Sub

but when it normal then form1 appear. I want otherForm will appear. Now it appear in the back of Form1.

Hello abu tahir
'if you want to minimize other forms but form1 cannot minimize so
'try this:
'if you will use 3 or 4 forms see it

Private Sub Command1_Click()
Form2.WindowState = 1
Form3.WindowState = 1
Form4.WindowState = 1
End Sub

Private Sub Form_Load()
Form2.Show
Form3.Show
Form4.Show

End Sub

' if show your all forms then you press command botton your all forms are minmized

not like this. supoose.... in FrmMain I click a button show FrmItem (another form). It was show. When I minmize FrmMain it was minimized with FrmItem. When I maximized FrmMain FrmItem not show in front. It show In back of FrmMain. I want it will show on front of FrmMain.

if me.windowstate=0 then
form2.windowstate=-1
form3.windowstate=1
end if

sorry mustafa it not work as my requeirment.

set focus to the form

frmItem.setfocus

it show a error massage:
run time error 5
Invalid proceduer call or argument.

i work a program that uses two pc and then connect them..
how can i minimize all the windows that i open ?
Example: someone was Surfing on the net and then he want to stop the time . i click the button so that all windows will be minimize, and only desktop currently shown.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.