Alrighty y'all, I'm sure I'm going nuts!
The following works
exactly as expected in xl '97:<code>
Private Sub ComboBox1_Enter()
ComboBox1.BackColor = RGB(255, 128, 128)
End Sub
Private Sub ComboBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
ComboBox1.BackColor = -2147483643
End Sub
Private Sub ListBox1_Enter()
ListBox1.BackColor = RGB(255, 128, 128)
End Sub
Private Sub ListBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
ListBox1.BackColor = -2147483643
End Sub
Private Sub OptionButton1_Enter()
OptionButton1.BackColor = RGB(255, 128, 128)
End Sub
Private Sub OptionButton1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
OptionButton1.BackColor = &H8000000F
End Sub
Private Sub TextBox1_Enter()
TextBox1.BackColor = RGB(255, 128, 128)
End Sub
Private Sub TextBox1_exit(ByVal Cancel As MSForms.ReturnBoolean)
TextBox1.BackColor = -2147483643
End Sub</code>
This time, I made sure to code what ought to be grey, grey and white, white. Don't know why this works for me and not y'all...
This fires correctly every time when I code it correctly (right control name in the procedure, right event name).
If you have two textboxes make sure all of them are coded correctly, e.g.,
Code:
Private Sub TextBox1_Enter()
TextBox1.BackColor = RGB(255, 128, 128)
End Sub
Private Sub TextBox1_Exit(ByVal Cancel As MSForms.ReturnBoolean)
TextBox1.BackColor = -2147483643
End Sub
Private Sub TextBox2_Enter()
TextBox2.BackColor = RGB(255, 128, 128)
End Sub
Private Sub TextBox2_Exit(ByVal Cancel As MSForms.ReturnBoolean)
TextBox2.BackColor = -2147483643
End Sub
If you don't replace textbox1 with textbox2, you will have issues....
Regards, Nate
This message was edited by NateO on 2002-11-21 01:52