I enhanced mehmetcik example file.
You can change the position of controls within the Resize event.
Because the form now has a button present you need to toggle the visibility of the controls.
Private Sub CheckBox1_Click()
If CheckBox1 = False Then Exit Sub
Label2.Visible = True
TextBox1.Visible = True
UserForm1.Height = 190
CheckBox2 = False
End Sub
Private Sub UserForm_Activate()
Label2.Visible = False
TextBox1.Visible = False
UserForm1.Height = 155.5
End Sub
Private Sub CheckBox2_Click()
If CheckBox2 = False Then Exit Sub
Label2.Visible = False
TextBox1.Visible = False
UserForm1.Height = 155.5
CheckBox1 = False
End Sub
Private Sub UserForm_Resize()
CommandButton1.Top = Me.InsideHeight - CommandButton1.Height - 4
End Sub
Bookmarks