ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Align the form to the top left (https://www.excelbanter.com/excel-programming/395069-align-form-top-left.html)

scott

Align the form to the top left
 
How to align the form to the top left? Right now when the form is
initialized, it is centrally aligned.

Jim Thomlinson

Align the form to the top left
 
Set the startup position in the initialize event.

Private Sub UserForm_Initialize()
UserForm1.StartUpPosition = 3
End Sub

--
HTH...

Jim Thomlinson


"Scott" wrote:

How to align the form to the top left? Right now when the form is
initialized, it is centrally aligned.


Vergel Adriano

Align the form to the top left
 

Private Sub UserForm_Initialize()
Me.StartUpPosition = 0
Me.Left = 0
Me.Top = 0
End Sub


--
Hope that helps.

Vergel Adriano


"Scott" wrote:

How to align the form to the top left? Right now when the form is
initialized, it is centrally aligned.


Jim Thomlinson

Align the form to the top left
 
I should have mentioned my use of 3. In VB (not VBA) there are constants for
the start up position. Here they are

vbStartUpManual 0 No initial setting specified.
vbStartUpOwner 1 Center on the item to which the UserForm belongs.
vbStartUpScreen 2 Center on the whole screen.
vbStartUpWindowsDefault 3 Position in upper-left corner of screen.

VBA does not have the same constants but you can declare them if you wish...
I just used 3...
--
HTH...

Jim Thomlinson


"Jim Thomlinson" wrote:

Set the startup position in the initialize event.

Private Sub UserForm_Initialize()
UserForm1.StartUpPosition = 3
End Sub

--
HTH...

Jim Thomlinson


"Scott" wrote:

How to align the form to the top left? Right now when the form is
initialized, it is centrally aligned.


scott

Align the form to the top left
 
Thanks. It works.

I've also found that I can select "3 - Windows Default" under
"StartUpPosition" on "Properties" of the form.

"Jim Thomlinson" wrote:

I should have mentioned my use of 3. In VB (not VBA) there are constants for
the start up position. Here they are

vbStartUpManual 0 No initial setting specified.
vbStartUpOwner 1 Center on the item to which the UserForm belongs.
vbStartUpScreen 2 Center on the whole screen.
vbStartUpWindowsDefault 3 Position in upper-left corner of screen.

VBA does not have the same constants but you can declare them if you wish...
I just used 3...
--
HTH...

Jim Thomlinson


"Jim Thomlinson" wrote:

Set the startup position in the initialize event.

Private Sub UserForm_Initialize()
UserForm1.StartUpPosition = 3
End Sub

--
HTH...

Jim Thomlinson


"Scott" wrote:

How to align the form to the top left? Right now when the form is
initialized, it is centrally aligned.


scott

Align the form to the top left
 
Thanks, it works.

"Vergel Adriano" wrote:


Private Sub UserForm_Initialize()
Me.StartUpPosition = 0
Me.Left = 0
Me.Top = 0
End Sub


--
Hope that helps.

Vergel Adriano


"Scott" wrote:

How to align the form to the top left? Right now when the form is
initialized, it is centrally aligned.



All times are GMT +1. The time now is 01:04 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com