Color Bar Program in VB6

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: design 3. Now put this code for your code module.
  1. Private Sub Form_Load()
  2.     Me.Caption = "Color Bar"
  3. End Sub
  4.  
  5. Private Sub H1_Change()
  6.     Me.BackColor = RGB(H1.Value, H2.Value, H3.Value)
  7.     Label4.Caption = "Red = " & H1.Value & " ," & "Green = " & H2.Value & "," & "Blue = " & H3.Value
  8. End Sub
  9.  
  10. Private Sub H2_Change()
  11.     Me.BackColor = RGB(H1.Value, H2.Value, H3.Value)
  12.     Label4.Caption = "Red = " & H1.Value & " ," & "Green = " & H2.Value & "," & "Blue = " & H3.Value
  13. End Sub
  14.  
  15. Private Sub H3_Change()
  16.     Me.BackColor = RGB(H1.Value, H2.Value, H3.Value)
  17.     Label4.Caption = "Red = " & H1.Value & " ," & "Green = " & H2.Value & "," & "Blue = " & H3.Value
  18. End Sub
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.

Output:

output output output 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

Add new comment