|
-
Jun 30th, 2003, 08:29 AM
#1
Thread Starter
Lively Member
Hex Colours in .net ??? (Sorted)
i need to set the colour of a menu to this style but when i create the style it needs to be in .net not in a style sheet as they are generated @ runtime ... but how do i add hex values in vb.net ?
the following don't work 
MyStyle.BackColor = Color.FromName()
MyStyle.BackColor = Color.FromArgb()
MyStyle.BackColor = Color.FromKnownColor
do i need to setup a colour object ??
many thanks
john
Last edited by OptimusPrime; Jun 30th, 2003 at 09:26 AM.
-
Jun 30th, 2003, 08:37 AM
#2
Thread Starter
Lively Member
i tried the colour object thing but couldn't add a hex value ... it needs to be set to #003366 btw
-
Jun 30th, 2003, 09:23 AM
#3
Addicted Member
The easiest thing would probably be to convert your hex value to an RGB value and then use the Color.FromARGB function. This link is to an example in VB. It shouldn't be hard to convert it to VB.NET.
-
Jun 30th, 2003, 09:25 AM
#4
Thread Starter
Lively Member
just sorted it .... 2 secs and ill post up what i did
-
Jun 30th, 2003, 09:27 AM
#5
Thread Starter
Lively Member
PHP Code:
Dim MyColourTranslator As ColorTranslator
MyStyle.BackColor = MyColourTranslator.FromHtml("#003366")
which works fine
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|