cdxf
cdxf

Reputation: 5648

How to set label backcolor in VB.Net

Here is the code :

Chess(z).BackColor = #FFFFFF

It is not working, how to make it work :))

Upvotes: 1

Views: 42719

Answers (2)

Guffa
Guffa

Reputation: 700910

You can use color constants:

Chess(z).BackColor = Color.White

Or create a color value from color components

Chess(z).BackColor = Color.FromArgb(&HFF, &HFF, &HFF)

Upvotes: 9

dsolimano
dsolimano

Reputation: 9016

If you are using Windows Forms, you probably want System.Drawing.Color. You can either use the static property White or in the general case you can construct your own color using the FromArgb method.

If you are using WPF, you can achieve something similar by using System.Windows.Media.Colors.White, or constructing your own color using the FromRgb method on System.Windows.Media.Color.

Upvotes: 1

Related Questions