What is the Command to Minimize Windows Maximize Windows switch Windows close Windows without using the mouse?

VB Excel form has no minimize or maximize button, only has close button?

  • VB Excel form has no minimize or maximize button, only has close button. OK, im using Excel and have made a form using the Visual Basic Editor. My form is loading and is functional but when running it has no minimize button or maximize button on the form, all it has is a close button. I'm looking in the properties of the form and can not find anything that can be changed to make the maxi/minimize buttons to appear. I've read in other questions to set the Controls to true or something but I dont have anything that says control on my forms property. below are my only options. (Thanks for all who try to help me!) APPEARANCE BackColor BoaderColor BorderStyle Caption ForeColor SpecialEffect BEHAVIOR Cycle Enabled RighttoLeft ShowModal FONT Font MISC. Name DrawBuffer HelpContexID MouseIcon MousePointer Tag WhatsThisButton WhatsThisHelp Zoom PICTURE Picture PictureAlignment PictureSizeMode PictureTiling POSITION Height Left StarUpPosition Top Width SCROLLING KeepScrollBarsVisible ScrollBars ScrollHeight ScrollLeft ScrollTop ScrollWidth

  • Answer:

    Forms in MS-Excel are not as sophisticated as they are in MS-Access, which is a much more friendly development environment. You will need to add a several lines of code to get this type of functionality. So use the following: Option Explicit Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long) As Long Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hWnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long Private Declare Function DrawMenuBar Lib "user32" (ByVal hWnd As Long) As Long Private Declare Function ShowWindow Lib "user32" (ByVal hWnd As Long, ByVal nCmdShow As Long) As Long Private Const GWL_STYLE As Long = (-16) Private Const WS_SYSMENU As Long = &H80000 Private Const WS_MINIMIZEBOX As Long = &H20000 Private Const WS_MAXIMIZEBOX As Long = &H10000 Private Const SW_SHOWMAXIMIZED = 3 Private Sub UserForm_Activate() Dim lFormHandle As Long, lStyle As Long lFormHandle = FindWindow("ThunderDFrame", Me.Caption) lStyle = GetWindowLong(lFormHandle, GWL_STYLE) lStyle = lStyle Or WS_SYSMENU 'SystemMenu lStyle = lStyle Or WS_MINIMIZEBOX 'With MinimizeBox lStyle = lStyle Or WS_MAXIMIZEBOX 'and MaximizeBox SetWindowLong lFormHandle, GWL_STYLE, (lStyle) DrawMenuBar lFormHandle End Sub

lolpeopl... at Yahoo! Answers Visit the source

Was this solution helpful to you?

Other answers

There is no property that allows you to add the Minimize\Maximize buttons on a VBA Userform. I found this code that makes API calls to add the buttons. I just pasted the code to the userformm module and it worked. Very cool. How do I minimize a userform http://www.mrexcel.com/archive/VBA/24009.html

Cozmosis

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.