?
Solved

How to maximize a window in another way

Posted on 2002-05-30
6
Medium Priority
?
208 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 1

Accepted Solution

by:
alaplume earned 200 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
Independent Software Vendors: 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!

 
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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 …
When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…
Suggested Courses

770 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