Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set the size of the application window 6

Status
Not open for further replies.

KirkJewell

Programmer
Oct 6, 2000
54
GB
I want to set the size of the application window and turn off the close/max/min buttons (of the app window) Can it be done?
 
Yeah it can be done.

In the form design, goto the forms properties and you can remove the buttons from the window.

To resize it, if you could use thje Windows API function MoveWindow, using the hwnd property of your form. Just call this in the Forms OnLoad or something.

Rob
 
Re:Your first paragraph
Yes what you have said is true for a form, but not for the application window itself. (Which works fine until you maximise the form and then the min/max and close buttons reappear (unless you remove any toolbars or menus!!)

Re:Your second paragraph
I don't have any references to the Windows API's (or how to use them) Do you have any code which might enable me to access the Application Window.
 
KirkJewell:
This code should do it...
Create a Code module to hold this:
Declare Function MoveWindow Lib "user32.dll" (ByVal hwnd As Long, ByVal x As Long, ByVal y As Long, ByVal nWidth As Long, _
ByVal nHeight As Long, ByVal bRepaint As Long) As Long


Then in your Form_Load of your form...
Private Sub Form_Load()
Dim retval As Long

retval = MoveWindow(Application.hWndAccessApp, 200, 150, 300, 500, 1)

End Sub

I found this info at You can find out a lot about different API calls from VB/VBA there.
 
Mogryph,

Thank you for an excellent site reference--add a star!*
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top