Solved

How to maximize a window in another way

Posted on 2002-05-30
6
200 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

760 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

21 Experts available now in Live!

Get 1:1 Help Now