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

vb colors

lee123
100+
P: 556
is there a way to customize your own colors (Back colors)like "Burgandy", "champagne", "Teal", "Dusty Rose" things like this.

if so how would i do this?
lee123
Dec 2 '07 #1
Share this Question
Share on Google+
3 Replies


lotus18
100+
P: 866
is there a way to customize your own colors (Back colors)like "Burgandy", "champagne", "Teal", "Dusty Rose" things like this.

if so how would i do this?
lee123
Hi lee

I'm not sure about this if this is what you really want. I think you need to create a sub function for that

Here's my simple code:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Form_Load()
  2.     'Assuming Burgandy. I don't know the exact color : )
  3.     Me.Burgandy 0, 100, 100
  4. End Sub
  5.  
  6. Sub Burgandy(r As Long, g As Long, b As Long)
  7.     Me.BackColor = RGB(r, g, b)
  8. End Sub
  9.  
Rey Sean
Dec 3 '07 #2

lotus18
100+
P: 866
Or you can create CustomColors class module, then under that class you can create sub-class (I'm not sure if this is the correct term), then instantiate the new class.

CustomColors
Expand|Select|Wrap|Line Numbers
  1.  
  2. 'CustomColors Class 
  3. Public Sub Burgandy(r as Long, g as Long, b as Long)
  4.      <codes here>
  5. End Sub
  6.  
  7. Public Sub Magenta(r as Long, g as Long, b as Long)
  8.      <codes here>
  9. End Sub
  10.  
Call it

Expand|Select|Wrap|Line Numbers
  1. Private Form_Load()
  2.     Me.Burgandy (100, 100, 100)
  3. End Sub
  4.  
Rey Sean
Dec 3 '07 #3

lee123
100+
P: 556
hi (lotus18)

i'll give these a try and write back if it works thanks for the response.

lee123
Dec 3 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.