rpaulson
Well-known Member
- Joined
- Oct 4, 2007
- Messages
- 1,428
Here is my code that runs then the user clicks a button on the form.
When the user click it the first time it turns green
When the click it a second time it underline the text
when they click it a third time, I need it to go back to gray.
Then 3rd part is not working.
anyone know what I'm missing here?
Ross
Code:
Sub Toggle(Button)
With Button
If .BackColor = &H8000000F Then 'if its gray
.BackColor = &H80FF80 'turn green
.Font.Bold = True
.Font.Size = 70
.Left = .Left - 25
.Width = .Width + 50
.Top = .Top - 25
.Height = .Height + 50
ElseIf .Font.Bold = True Then .Font.Underline = True
Else 'turn back to gray
.BackColor = &H8000000F
.Font.Bold = False
.Font.Size = 30
.Left = .Left + 25
.Width = .Width - 50
.Top = .Top + 25
.Height = .Height - 50
.Font.Underline = False
End If
End With
End Sub
Private Sub CommandButton1_Click()
Call Toggle(CommandButton1)
End Sub
When the user click it the first time it turns green
When the click it a second time it underline the text
when they click it a third time, I need it to go back to gray.
Then 3rd part is not working.
anyone know what I'm missing here?
Ross