Skip to content

Latest commit

 

History

History
48 lines (35 loc) · 1.5 KB

startupposition-property.md

File metadata and controls

48 lines (35 loc) · 1.5 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
StartUpPosition property (Visual Basic for Applications)
vblr6.chm1100523
vblr6.chm1100523
Office.StartUpPosition
0ceb1e6d-b45e-a1df-03df-fd73ce814a79
12/19/2018
medium

StartUpPosition property

Returns or sets a value specifying the position of a UserForm when it first appears. Use one of four settings for StartUpPosition.

Setting Value Description
Manual 0 No initial setting specified.
CenterOwner 1 Center on the item to which the UserForm belongs.
CenterScreen 2 Center on the whole screen.
WindowsDefault 3 Position in upper-left corner of screen.

Remarks

You can set the StartUpPosition property programmatically or from the Properties window.

Example

The following example uses the Load statement and the Show method in UserForm1's Click event to load UserForm2 with the StartUpPosition property set to 3 (the Windows default position). The Show method then makes UserForm2 visible.

Private Sub UserForm_Click()
    Load UserForm2
    UserForm2.StartUpPosition = 3
    UserForm2.Show
End Sub

See also

[!includeSupport and feedback]