VB.NET PictureBox.BackColor setting

Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

tim8w

Thread Starter
Joined
Nov 9, 2004
Messages
35
How do I set the PictureBox.BackColor to a non-System.Drawing.Color value?

I'm trying to set the following:

Code:
MyPictureBox.BackColor = &HC000&
MyPictureBox.BackColor = RGB(255, 255, 0)
I get the following error:

Value of type 'Integer' cannot be converted to 'System.Drawing.Color'


If I try the following:

Code:
MyPictureBox.BackColor.FromArgb(255, 255, 0)
I get the following warning:

Access of shared member, constant member, enum member or nested type through an instance; qualifying expression will not be evaluated.
 

tim8w

Thread Starter
Joined
Nov 9, 2004
Messages
35
I found the answer:

Code:
MyPictureBox.BackColor = Color.FromArgb(255, 255, 0)
 
Status
This thread has been Locked and is not open to further replies. Please start a New Thread if you're having a similar issue. View our Welcome Guide to learn how to use this site.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 807,865 other people just like you!

Latest posts

Members online

Top