By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,458 Members | 1,201 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,458 IT Pros & Developers. It's quick & easy.

Problem wyth colors (uint, hexa)

P: n/a
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
Jan 18 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
<al****@gmail.comwrote in message
news:52**********************************@c23g2000 hsa.googlegroups.com...
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.

Jan 19 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.