|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Restore Form to Prior StateIm trying to rstore a form to its prior state.
If you minimize a form and then right click on it in the taskbar then there is a menu item labeled "Restore". That is what i want to emulate. Note that simply using me.windowstate = vbnormal will not work as I want. i want to restore the form as it was before it got minimized. So it may be maximized or just normal. I just cant figure out how to do it. tia AGP AGP wrote:
> Im trying to rstore a form to its prior state. Save the previous WindowState, and then set it back to that in the Restore> If you minimize a form and then right click on it in the > taskbar then there is a menu item labeled "Restore". > That is what i want to emulate. > > Note that simply using me.windowstate = vbnormal > will not work as I want. i want to restore the form as > it was before it got minimized. So it may be maximized > or just normal. > > I just cant figure out how to do it. action. -- Regards, Michael Cole OK forgot to mention that...but I have already tried that...
in what event shall I save the state...the Form_Resize happens after the form has been changed so I cant save the prior state. I need an event that happens before the form is changed. AGP Show quoteHide quote "Michael Cole" <no***@hansen.com> wrote in message news:u3iuUxZYFHA.3280@TK2MSFTNGP09.phx.gbl... > AGP wrote: > > Im trying to rstore a form to its prior state. > > If you minimize a form and then right click on it in the > > taskbar then there is a menu item labeled "Restore". > > That is what i want to emulate. > > > > Note that simply using me.windowstate = vbnormal > > will not work as I want. i want to restore the form as > > it was before it got minimized. So it may be maximized > > or just normal. > > > > I just cant figure out how to do it. > > Save the previous WindowState, and then set it back to that in the Restore > action. > > -- > Regards, > > Michael Cole > > On Thu, 26 May 2005 02:52:48 GMT, "AGP" <sindizzy.***@softhome.net> Simplest way is to use ShowWindow with SW_RESTORE:wrote: >OK forgot to mention that...but I have already tried that... >in what event shall I save the state...the Form_Resize happens >after the form has been changed so I cant save the prior state. >I need an event that happens before the form is changed. 'declares... Private Const SW_RESTORE = 9 Private Declare Function ShowWindow Lib "user32" _ (ByVal hWnd As Long, ByVal nCmdShow As Long) As Long 'usage... ShowWindow Me.hWnd, SW_RESTORE -Tom MVP - Visual Basic (please post replies to the newsgroup) "Tom Esh" <tjeshGibber***@suscom.net> wrote in message ShowWindow()! Yeah, that's right. I was going to send him the long way with news:69fa915p38gjt013nbed9ge1uhddc54qqt@4ax.com... > Simplest way is to use ShowWindow with SW_RESTORE: a WM_SYSCOMMAND message.... On Thu, 26 May 2005 00:21:06 -0400, "Jeff Johnson [MVP: VB]"
<i.get@enough.spam> wrote: >ShowWindow()! Yeah, that's right. I was going to send him the long way with Yup, plus it has the side benefit of working even when the form's>a WM_SYSCOMMAND message.... ControlBox prop is False. (Some syscommands don't unless you hack around it by removing the sysmenu at runtime with the Api.) -Tom MVP - Visual Basic (please post replies to the newsgroup) That is exactly what i was looking for.
It works. Thanks!!!! AGP Show quoteHide quote "Tom Esh" <tjeshGibber***@suscom.net> wrote in message news:69fa915p38gjt013nbed9ge1uhddc54qqt@4ax.com... > On Thu, 26 May 2005 02:52:48 GMT, "AGP" <sindizzy.***@softhome.net> > wrote: > > >OK forgot to mention that...but I have already tried that... > >in what event shall I save the state...the Form_Resize happens > >after the form has been changed so I cant save the prior state. > >I need an event that happens before the form is changed. > > Simplest way is to use ShowWindow with SW_RESTORE: > > 'declares... > Private Const SW_RESTORE = 9 > Private Declare Function ShowWindow Lib "user32" _ > (ByVal hWnd As Long, ByVal nCmdShow As Long) As Long > > 'usage... > ShowWindow Me.hWnd, SW_RESTORE > > > -Tom > MVP - Visual Basic > (please post replies to the newsgroup)
VB.net vs VB 6.0
for, this is a complex problem.... Correct way to get random results with arrays Run IE from VB6 ? Friend Property ques updating multiple records with VBScript and SQL Problem returning DISTINCT records - MS Access How do your read selected values from a BOUND ListBox in VB.Net Detecting if Control key is pressed with...end with and the picturebox |
|||||||||||||||||||||||