av8tordude
05-22-2009, 08:49 AM
I found this code through a search engine and was trying to revise it to fit my userform.
Dim dHeight As Double
Private Sub ToggleButton1_Click()
If ToggleButton1.Value = True Then
Me.Height = Me.Height * 0.5
Else
Me.Height = dHeight
End If
End Sub
Private Sub UserForm_Initialize()
dHeight = Me.Height
End
In the Enter button I put this code to minimize the userform when I click the enter button and and change the toggle button to true:
Me.Height = Me.Height * 0.25
ToggleButton1.Value = True
The 0.25 size is the size I wan the userform to be when I minimize the userform.
When the userform is minimize, I have a toggle button to maximize the userform. Unfornuately, when I click the toggle button again to minimize the userform, it doesn't minimize the userform to 0.25. It minimizes the userform to 0.50.
How can I get this code to minimize to the 0.25 size all the time?
Dim dHeight As Double
Private Sub ToggleButton1_Click()
If ToggleButton1.Value = True Then
Me.Height = Me.Height * 0.5
Else
Me.Height = dHeight
End If
End Sub
Private Sub UserForm_Initialize()
dHeight = Me.Height
End
In the Enter button I put this code to minimize the userform when I click the enter button and and change the toggle button to true:
Me.Height = Me.Height * 0.25
ToggleButton1.Value = True
The 0.25 size is the size I wan the userform to be when I minimize the userform.
When the userform is minimize, I have a toggle button to maximize the userform. Unfornuately, when I click the toggle button again to minimize the userform, it doesn't minimize the userform to 0.25. It minimizes the userform to 0.50.
How can I get this code to minimize to the 0.25 size all the time?