Sign in to follow this  

Visual Basic If,Then question

This topic is 3843 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Is it possible to make a variable with a specific color? For example can u make a If,Then statement like this. If "Color" = Blue Then set "Click" = true "Color" and "Click" are variables. Is it possible to do this and is there a tool to get the color?

Share this post


Link to post
Share on other sites
I'm not exactly sure how this works in Visual Basic, but I imagine that you use some kind of hexadecimal notation for colors.

Example:

Red = 0xffff0000
Blue = 0xff0000ff
Green = 0xff00ff00
Black = 0xff000000
White = 0xffffffff

In this way, a four-byte value such as an int can store colors.

Share this post


Link to post
Share on other sites
It's been over a year since I last used VB.NET, so this is from memory. You probably want something like this:
Dim myColour as Color
Dim wasClicked as Boolean
If myColor = Color.Blue Then
wasClicked = True
End If


Syntax and whatnot might not be right.

Share this post


Link to post
Share on other sites

This topic is 3843 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this