K
kronecker
I found this nifty routine that closes a form one by one every time it
is called. However, I need to hide them instead of closing them. Is
there a way to alter the code? I assume it has something to do with
this line here...
PostMessage(i, CInt(&H10), vbNullString, vbNullString)
Thanks
k
Public Sub closeallforms()
Dim objType As Type() =
Reflection.Assembly.GetExecutingAssembly.GetTypes()
Dim x As Integer, i As Integer
Try
For x = LBound(objType) To UBound(objType)
If Not objType(x).Name = Me.Name Then '/// make sure
you dont unload this form yet.
i = FindWindow(vbNullString, objType(x).Name)
PostMessage(i, CInt(&H10), vbNullString,
vbNullString)
End If
Next
Catch ex As Exception
MessageBox.Show("Oops, the following error occured:" &
ex.Message)
Finally
'MyBase.Close() '/// now that all the other forms are
closed , unload this one.
End Try
End Sub
is called. However, I need to hide them instead of closing them. Is
there a way to alter the code? I assume it has something to do with
this line here...
PostMessage(i, CInt(&H10), vbNullString, vbNullString)
Thanks
k
Public Sub closeallforms()
Dim objType As Type() =
Reflection.Assembly.GetExecutingAssembly.GetTypes()
Dim x As Integer, i As Integer
Try
For x = LBound(objType) To UBound(objType)
If Not objType(x).Name = Me.Name Then '/// make sure
you dont unload this form yet.
i = FindWindow(vbNullString, objType(x).Name)
PostMessage(i, CInt(&H10), vbNullString,
vbNullString)
End If
Next
Catch ex As Exception
MessageBox.Show("Oops, the following error occured:" &
ex.Message)
Finally
'MyBase.Close() '/// now that all the other forms are
closed , unload this one.
End Try
End Sub