|
-
Jan 28th, 2007, 06:38 AM
#1
Thread Starter
Junior Member
[2005] testing colors in VB
Hi - newbie to VB - am using Textboxes to dispolay text and have the textboxes colored yellow, white and red depending upon their designation. I want to use the double-click event processing of the textboxes (using event handler) and take different actions depending upon the color of the textbox. I set the color as shown (this works OK):
TextBox1.BackColor = Color.Yellow
I attemp to test the color with the following (this does not work)
if TextBox1.BackColor = Color.Yellow then
' do something'
end if
if TextBox1.BackColor = Color.Red then
' do something else'
end if
This creates an error and does not work and I have not been able to find the way to test this and take appropriate action. Help would be appreciated in the way to test the BackColor existing and take action depending on what this color is.
Thanks and cheers
Ross
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|