Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
TextBox Color Change
Hi All, I want to make my TextBoxes a little more fancy. What code is best to use when I move my mouse over the TextBox - i changes color - and when the mouse moves off it changes back to th original color? I have tried the Class Module, but I somehow can't figure it out. Hope you got the anwser:):) Lenn -- Lenny_82 ----------------------------------------------------------------------- Lenny_821's Profile: http://www.excelforum.com/member.php...fo&userid=1517 View this thread: http://www.excelforum.com/showthread.php?threadid=38048 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
TextBox Color Change
Hi Lenny,
I hope you are talking about Userform textboxes. Then you can use this in the Form code: Private Sub TextBox1_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single) If UserForm1.TextBox1.Tag = 0 Then UserForm1.TextBox1.BackColor = &H80FF& 'the changed color UserForm1.TextBox1.Tag = 1 End If End Sub Private Sub UserForm_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single) If UserForm1.TextBox1.Tag = 1 Then UserForm1.TextBox1.BackColor = &HFFFFFF 'the regular color UserForm1.TextBox1.Tag = 0 End If End Sub If you want to change color of the Textbox from Drawing Toolbar then I canīt help you. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
TextBox Color Change
Hi Lenny,
I forgot one thing: set the textbox tag to 0 before you run the code. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
TextBox Color Change
Hi Roman, Thanks for your help:) Lenny -- Lenny_821 ------------------------------------------------------------------------ Lenny_821's Profile: http://www.excelforum.com/member.php...o&userid=15179 View this thread: http://www.excelforum.com/showthread...hreadid=380489 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Checkbox to change background color, font color and remove/ add bo | Excel Discussion (Misc queries) | |||
How to change the default Border, Font Color, and Cell Color | Excel Discussion (Misc queries) | |||
Changing font color of textbox text..... | Excel Programming | |||
Browse Forms Controls and change TextBox color based on cell color | Excel Programming | |||
Textbox change event | Excel Programming |