Important alert: (current site time 7/16/2013 12:50:36 AM EDT)
 

VB icon

[ RGB Form Colour Changer ]

Email
Submitted on: 9/10/2003 6:18:49 AM
By: JamesJD  
Level: Beginner
User Rating: By 3 Users
Compatibility: VB 3.0, VB 4.0 (16-bit), VB 4.0 (32-bit), VB 5.0, VB 6.0
Views: 21600
author picture
(About the author)
 
     This little code will allow you to change the forms colour using Scroll Bar and Text Boxes, this can be changed to change the colour of a Text Box, etc. Please vote and leave your comments :)

 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.
				
'**************************************
' Name: [ RGB Form Colour Changer ]
' Description:This little code will allow you to change the forms colour using Scroll Bar and Text Boxes, this can be changed to change the colour of a Text Box, etc. Please vote and leave your comments :)
' By: JamesJD
'
' Inputs:Three Scroll Bars named: hsbRed, hsbGreen, and hsbBlue. Also three Text Boxes named: txtRed, txtGreen, and txtBlue.
'
'This code is copyrighted and has' limited warranties.Please see http://www.Planet-Source-Code.com/vb/scripts/ShowCode.asp?txtCodeId=48392&lngWId=1'for details.'**************************************

Private Sub Form_Load()
hsbRed.Value = 255
hsbGreen.Value = 255
hsbBlue.Value = 255
End Sub
Private Sub hsbBlue_Change()
Form1.BackColor = RGB(hsbRed.Value, hsbGreen.Value, hsbBlue.Value)
txtBlue.Text = hsbBlue.Value
End Sub
Private Sub hsbGreen_Change()
Form1.BackColor = RGB(hsbRed.Value, hsbGreen.Value, hsbBlue.Value)
txtGreen.Text = hsbGreen.Value
End Sub
Private Sub hsbRed_Change()
Form1.BackColor = RGB(hsbRed.Value, hsbGreen.Value, hsbBlue.Value)
txtRed.Text = hsbRed.Value
End Sub
Private Sub txtBlue_Change()
hsbBlue.Value = txtBlue.Text
End Sub
Private Sub txtGreen_Change()
hsbGreen.Value = txtGreen.Text
End Sub
Private Sub txtRed_Change()
hsbRed.Value = txtRed.Text
End Sub


Other 21 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

10/10/2004 4:17:30 PM

You might want to add that the max for the scroll bars should be at 255. But other than that, the code's cool.
(If this comment was disrespectful, please report it.)

 
4/1/2005 10:14:01 PM

ya man! u have really created a simple but very interesting code .keep it up and i hope u innovate the best out of u in future
(If this comment was disrespectful, please report it.)

 
1/26/2007 3:58:01 AMMorrison

The contects are very educative an d wel thought of.Congrats.
(If this comment was disrespectful, please report it.)

 
3/11/2007 12:14:40 PMjennie

thnx to this site..it really helps me a lot...

(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.