• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 210
  • Last Modified:

How to maximize a window in another way

I would like to maximize a window by double-clicking a control inside of it, not only by clicking the maximize button. Also, when window is maximized, another double-click on the control would restore it.
How to do that?
Thanks.
0
robertut
Asked:
robertut
1 Solution
 
alaplumeCommented:
Just write code behind the control that you want to click on that will change the window state.

me.windowstate=vbmaximized

me.windowstate=vbnormal
0
 
BahnassCommented:
on the double click event of Ur control


Me.WindowState=2    'max


to restore
Me.WindowState=0    'Normal
0
 
raizonCommented:
in your double click event

If Form1.windowstate = vbMaximized Then
  Form1.windowstate = vbNormal
Else
  Form1.windowstate = vbMaximied
End If
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
BahnassCommented:
Yes alaplume  
I'm too late !!
0
 
raizonCommented:
lol me too
0
 
nichiaCommented:
You can access the form that the UserControl is on using the Parent property like this:

Private Sub UserControl_DblClick()
    If (Usercontrol.Parent.Windowstate = vbMaximized) Then
        Usercontrol.Parent.Windowstate = vbNormal
    Else
        Usercontrol.Parent.Windowstate = vbMaximized
    EndIf
End Sub
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now