P
Patrick A
All,
I have a form with 20 buttons on it, and I would like to give the user
the ability to change the color of any individual button and have it
"saved" so that the next time they use the app, the button is the
color they set it to. At present, the user would make the change by
selecting a color value on a "data entry" form.
I know how to set the color of a button by hard coding it:
NewButton.BackColor = Color.AliceBlue
I know how to get the color value (in hex, rgb or name, e.g.
AliceBlue) from my DB or INI file.
But for the life of me, I can not figure out how to get VB to use it
to set the color.
With my color coming in as tp!butColor, I have tried using the
variations of the hex, rgb and name, and variations of;
NewButton.BackColor = tp!butColor
NewButton.BackColor = ColorTranslator.FromOle(tp!butColor)
NewButton.BackColor = System.Drawing.ColorConverter(tp!butcolor(0))
But I get one "cast is not valid" or "conversion" error after another.
Can anyone point me in the right direction? Which value should I
read, and how should I set it and cast it?
Thanks,
Patrick
I have a form with 20 buttons on it, and I would like to give the user
the ability to change the color of any individual button and have it
"saved" so that the next time they use the app, the button is the
color they set it to. At present, the user would make the change by
selecting a color value on a "data entry" form.
I know how to set the color of a button by hard coding it:
NewButton.BackColor = Color.AliceBlue
I know how to get the color value (in hex, rgb or name, e.g.
AliceBlue) from my DB or INI file.
But for the life of me, I can not figure out how to get VB to use it
to set the color.
With my color coming in as tp!butColor, I have tried using the
variations of the hex, rgb and name, and variations of;
NewButton.BackColor = tp!butColor
NewButton.BackColor = ColorTranslator.FromOle(tp!butColor)
NewButton.BackColor = System.Drawing.ColorConverter(tp!butcolor(0))
But I get one "cast is not valid" or "conversion" error after another.
Can anyone point me in the right direction? Which value should I
read, and how should I set it and cast it?
Thanks,
Patrick