Color Bar Program in VB6
Submitted by donbermoy on Wednesday, March 26, 2014 - 21:53.
Color bar is a strip on printed material or a screen display showing a range of colors, used to ensure that all colors are printed or displayed correctly. But in this program, we will just make use of the RGB Color with the use of scrollbars.
Now, let's start this tutorial!
1. Let's start this tutorial by following the following steps in Microsoft Visual Basic 6.0: Open Microsoft Visual Basic 6.0, click Choose Standard EXE, and click Open.
2. Next, insert three labels named Label1 labeled as "Red", Label2 labeled as "Green", Label3 labeled as "Blue", and Label4 for displaying the value of the RGB color. Add three Horizontal Scrollbar named H1 for Color Red, H2 for Color Green, and H3 for Color Blue. Make their Min Property to 0 and Max Property to 255 as RGB color corresponds this. You must design your interface like this:
3. Now put this code for your code module.
RGB Function returns an Integer value representing an RGB color value from a set of red, green and blue color components. The BackColor property will change the form's background when changing the value of the scrollbars as it is connected to RGB function. H1 value corresponds to Red color, H2 corresponds to Green color, and H3 corresponds to the value of Green Color.
Download the source code and try it! :)
For more inquiries and need programmer for your thesis systems in any kind of programming languages, just contact my number below.
Best Regards,
Engr. Lyndon Bermoy
IT Instructor/System Developer/Android Developer/Freelance Programmer
Mobile: 09488225971
Landline: 826-9296
E-mail:[email protected]
Add and Follow me on Facebook: https://www.facebook.com/donzzsky
Visit and like my page on Facebook at: https://www.facebook.com/BermzISware

- Private Sub Form_Load()
- Me.Caption = "Color Bar"
- End Sub
- Private Sub H1_Change()
- Me.BackColor = RGB(H1.Value, H2.Value, H3.Value)
- Label4.Caption = "Red = " & H1.Value & " ," & "Green = " & H2.Value & "," & "Blue = " & H3.Value
- End Sub
- Private Sub H2_Change()
- Me.BackColor = RGB(H1.Value, H2.Value, H3.Value)
- Label4.Caption = "Red = " & H1.Value & " ," & "Green = " & H2.Value & "," & "Blue = " & H3.Value
- End Sub
- Private Sub H3_Change()
- Me.BackColor = RGB(H1.Value, H2.Value, H3.Value)
- Label4.Caption = "Red = " & H1.Value & " ," & "Green = " & H2.Value & "," & "Blue = " & H3.Value
- End Sub
Output:



Add new comment
- 1087 views