How do I create a userform window (not dialogue box) with maximize, restore, & close buttons in the title bar? I want to do this under program control.
Do you want to do it in Word? Excel? Power Point? And what version of whatever you use.
In most cases, you may start by Alt-F11 (VBA editor), right-click on either VBAProject ot Sheet2 or whatever - (at least in Excel 2003) and choose Insert - UserForm
An important thing to know (I also just found out) If you select a control that you've added to the user form, and hit F7, it switches to code view and starts a subroutine for interacting with that control. This includes the form itself, resulting in a
[tt]
Private Sub Userform_click()
>
End sub
[/tt]
Just be sure to delete out any event routines you're not using.
Thanks for your responses but this isn't doing it for me. I'm trying to create a pure window in code with the intention of adding controls later, also in code. The underlying application is Excel.
See "UserForm Window" in the VBA help files. There, it says "Each form window has a Maximize, Minimize, and Close button". But inserting a userform only provides the Close button. How do I get the others? Do propertie xlMaximize, xlMinimize, etc. come into play?
Later, I may wish to remove the Title bar altogether. Can I do this?
Well, Microsoft does say in their Help: "Each form window has a Maximize, Minimize, and Close button.", but even the picture of the Form they have in Help does NOT have any of these buttons.
In 'classic' VB (VB 6.0) Form has BorderStyle property which allows you to select out of 6 different styles, but VBA has only 2 and none of them are what you want.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.