-
Hi again,
How do I *restore* my form to it's original state? After the user has minimized it, I want to be able to programatically restore it to what it was before it was minimized.
The closest I've got is "WindowState = vbNormal" but if the form was maximized before it was minimized, this doesn't actually re-maximize it.
I'm sure this is easy enough - any clues anyone?
Thanks for your help,
AndyC
------------------
* * * * * * * * * * * * * * * * * * * * * *
* *
* AndyC *
* London *
* email: [email protected] *
* *
* * * * * * * * * * * * * * * * * * * * * *
-
You can create a variable that would hold the state of the window and then resize to that last state.
Code:
Private m_lngState As Long
Private Sub Form_Resize()
If Not Me.WindowState = vbMinimized Then
m_lngState = Me.WindowState
End If
End Sub
Then whenever you want to restore that form you would put:
Form1.WindowState = m_lngState
------------------
Serge
Software Developer
[email protected]
[email protected]
ICQ#: 51055819
[This message has been edited by Serge (edited 11-19-1999).]
-
Sure! Declare a module level variable and set it's value in the Form_Resize event:
Private iOldWindowState As Integer
Private Sub Form_Resize()
If Me.WindowState <> vbMinimized Then
iOldWindowState = Me.WindowState
End If
End Sub
Now when you want to restore the window just set the Form's WindowState property to iOldWindowState
Good luck!
------------------
Joacim Andersson
[email protected]
[email protected]
www.YellowBlazer.com
-
Oh how easy!
Thanks folks.
AndyC
------------------
* * * * * * * * * * * * * * * * * * * * * *
* *
* AndyC *
* London *
* email: [email protected] *
* *
* * * * * * * * * * * * * * * * * * * * * *