Table of contents
TOC
Collapse the table of content
Expand the table of content

InsideHeight, InsideWidth Properties Example

office 365 dev account|Last Updated: 6/12/2017
|
1 Contributor

The following example uses the InsideHeight and InsideWidth properties to resize a CommandButton. The user clicks the CommandButton to resize it.

NoteInsideHeight and InsideWidth are read-only properties.

To use this example, copy this sample code to the Declarations portion of a form. Make sure that the form contains:

  • A CommandButton named CommandButton1.
Dim Resize As Single 

Private Sub UserForm_Initialize() 
 Resize = 0.75 
 CommandButton1.Caption = "Resize Button" 

End Sub 

Private Sub CommandButton1_Click() 
 CommandButton1.Move 10, 10, _ 
 UserForm1.InsideWidth * Resize, _ 
 UserForm1.InsideHeight * Resize 
 CommandButton1.Caption = "Button resized " _ 
 &; "using InsideHeight and InsideWidth!" 
End Sub
© 2018 Microsoft