Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / January 2008

Tip: Looking for answers? Try searching our database.

Problem wyth colors (uint, hexa)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
alayle@gmail.com - 18 Jan 2008 23:23 GMT
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
Alberto Poblacion - 19 Jan 2008 09:31 GMT
> This is the problem, i have a ocx, that have one control and one uint
> Property, like this
[quoted text clipped - 14 lines]
>
> 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.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.