Problem wyth colors (uint, hexa)

  • Thread starter Thread starter alayle
  • Start date Start date
A

alayle

This is the problem, i have a ocx, that have one control and one uint
Property, like this


Property color, acept values uint, Manually i set the value as this:

object.color = 0xFFFFFF;

for wythe color, i want to set the color using:

ocxObject.color = colorDialog1.Color; /// this is the error

and i get the error, because the ocxObject.color only acept uint

i make the convertion:

ocxObject.color = (uint)(colorDialog1.Color);

and not have error in code but, the colors not Match.

any solutions thanks
 
This is the problem, i have a ocx, that have one control and one uint
Property, like this


Property color, acept values uint, Manually i set the value as this:

object.color = 0xFFFFFF;

for wythe color, i want to set the color using:

ocxObject.color = colorDialog1.Color; /// this is the error

and i get the error, because the ocxObject.color only acept uint

i make the convertion:

ocxObject.color = (uint)(colorDialog1.Color);

and not have error in code but, the colors not Match.

Try applying the method ToOle in the class
System.Drawing.ColorTranslator. This converts a System.Drawing.Color to an
OLE Color, which might be what your OCX is expecting.
 

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

Back
Top