Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 93
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 93
Default TextBox Color Change

Hi Lenny,
I forgot one thing:
set the textbox tag to 0 before you run the code.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Checkbox to change background color, font color and remove/ add bo Sara Excel Discussion (Misc queries) 2 May 1st 23 11:43 AM
How to change the default Border, Font Color, and Cell Color Elijah Excel Discussion (Misc queries) 3 November 2nd 05 11:52 PM
Changing font color of textbox text..... jan Excel Programming 5 January 31st 05 08:10 PM
Browse Forms Controls and change TextBox color based on cell color StefanW Excel Programming 2 November 21st 04 07:06 PM
Textbox change event Ian Mangelsdorf Excel Programming 2 April 17th 04 09:30 AM


All times are GMT +1. The time now is 05:46 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright Đ2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"