convert RGB color to System.Drawing.Color?

G

Guest

I need to change my form's backcolor back to the design color after it
changes to
another system.Drawing.Color. In the backcolor design, the value is in RGB

me.BackColor = ...RGB(255, 255, 192)

This doesn't work. How can I change the RGB values to System.Drawing.Color?

Thanks
 
G

Guest

I think I figured this out.

me.BackColor = ColorTranslator.FromOle(RGB(255,255,192))

The trick is ColorTranslator.FromOle(...)
 
H

Herfried K. Wagner [MVP]

Rich said:
I need to change my form's backcolor back to the design color after it
changes to
another system.Drawing.Color. In the backcolor design, the value is in
RGB

me.BackColor = ...RGB(255, 255, 192)

This doesn't work. How can I change the RGB values to
System.Drawing.Color?

Take a look at 'Color.FromArgb'.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top