What are the codes for the various colors? And if I want to change the form's background color by using code, how do I do it?
Printable View
What are the codes for the various colors? And if I want to change the form's background color by using code, how do I do it?
form.backcolor = vbwhite
or vbred, vbblue and so on
or you could use numbers
the numbers are RGB values
so you could use the RGB() function
you give three numbers like RGB(255,0,0) 'would be red
where the first is the amount of red, the second of green, and blue)
0 is none 255 is the highest.
if you need white it would be 255,255,255, black would be 0,0,0
and grey just any the numbers that are the same 128,128,128
is there any way of creating a pallette of colors to enable the user to choose from and edit text colors, and so forth?
is there any way of creating a pallette of colors to enable the user to choose from and edit text colors, and so forth?
You could use the Choosecolor common dialog, for an example about that go to allapi.net .
Use the common dialog control...
Code:
Commondialog1.showcolor
form1.backcolor = commondialog1.color
Simple!