Part | Description | |
object | Required. A valid object. | |
Boolean | Optional. Whether the control is resized. |
Value | Description | |
True | Automatically resizes the control to display its entire contents. | |
False | Keeps the size of the control constant. Contents are clipped when they exceed the area of the control (default). |
Private Sub UserForm_Initialize()
TextBox1.Text = "Single-line TextBox. Type your text here."
TextBox2.MultiLine = True
TextBox2.Text = "Multi-line TextBox. Type your text here. " _
& "Use CTRL+ENTER to start a new line."
ToggleButton1.Value = True
ToggleButton1.Caption = "AutoSize On"
TextBox1.AutoSize = True
TextBox2.AutoSize = True
End Sub
Private Sub ToggleButton1_Click()
If ToggleButton1.Value = True Then
ToggleButton1.Caption = "AutoSize On"
TextBox1.AutoSize = True
TextBox2.AutoSize = True
Else
ToggleButton1.Caption = "AutoSize Off"
TextBox1.AutoSize = False
TextBox2.AutoSize = False
End If
End Sub