Solved

How to maximize a window in another way

Posted on 2002-05-30
6
202 Views
Last Modified: 2010-05-02
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
Comment
Question by:robertut
6 Comments
 
LVL 1

Accepted Solution

by:
alaplume earned 50 total points
ID: 7044638
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
 
LVL 3

Expert Comment

by:Bahnass
ID: 7044649
on the double click event of Ur control


Me.WindowState=2    'max


to restore
Me.WindowState=0    'Normal
0
 
LVL 5

Expert Comment

by:raizon
ID: 7044651
in your double click event

If Form1.windowstate = vbMaximized Then
  Form1.windowstate = vbNormal
Else
  Form1.windowstate = vbMaximied
End If
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 3

Expert Comment

by:Bahnass
ID: 7044653
Yes alaplume  
I'm too late !!
0
 
LVL 5

Expert Comment

by:raizon
ID: 7044654
lol me too
0
 
LVL 3

Expert Comment

by:nichia
ID: 7044823
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now