BugMan
Well-known member
I want to be able to set the color of a DGV cell based upon a choice by the user. Assume the user has a list to choose from:
Aqua
Azure
Beige
Bisque
Black
Coral
Plum
Tomato
etc. to about 20 colors.
I want to set the color of the cell using the users selection. Ideally, it would look something like this:
Of course, this doesn't work. Is there a way to set the color using a variable? Right now I have a bunch of Select Case lines, but it seems very inefficient.
Surely there is a way. thanks in advance.
Aqua
Azure
Beige
Bisque
Black
Coral
Plum
Tomato
etc. to about 20 colors.
I want to set the color of the cell using the users selection. Ideally, it would look something like this:
VB.NET:
Dim dummy as string
'get color from list selection
dummy = "Coral"
DataGridView1.Rows(0).Cells(1).Style.BackColor = Color. & dummy
Of course, this doesn't work. Is there a way to set the color using a variable? Right now I have a bunch of Select Case lines, but it seems very inefficient.
Surely there is a way. thanks in advance.