Color Handling for Visual Basic 6.0: Background Color Program

with 1 Comment

The background color is very essential for everything. Suppose you create something but you could not give background colour, that time you’re in VB will see fed-up. So, for your better program in Visual Basic, we are going to discuss on Color Handling for Visual Basic 6.0 for background color program.



Color Handling for Visual Basic: Create a Program in VB to insert Window Background Color

Step 1: –

  • At first open Visual Basic 6.0 application software
  • Then click on or select ‘Standard EXE’ icon from New Project dialog box
  • Then click on ‘Open’.

Step 2: –

Form Design: –

Select necessary Control Tool from Tool Box and adjust the position to ‘Form Window’: –

  • Five Command Box

Color Handling for Visual Basic

Step 3: –



Properties Settings: –

  • Select ‘Form1’from Form Window and select ‘Caption’ from Properties Window
  • Then replace ‘Form1’ to ‘Background Color Project’ from properties window
  • Then select ‘Command1 box’ from Form Window and select ‘Caption’ from Properties Window
  • Then replace ‘Command1’ to ‘RED’ from Properties Window.
  • Then select ‘Command 2 box’ from Form Window and select ‘Caption’ from Properties Window
  • Then replace ‘Command 2’ to ‘GREEN’ from Properties Window.
  • Then select ‘Command 3 box’ from Form Window and select ‘Caption’ from Properties Window
  • Then replace ‘Command 3’ to ‘BLACK’ from Properties Window.
  • Then select ‘Command 4 box’ from Form Window and select ‘Caption’ from Properties Window
  • Then replace ‘Command 4’ to ‘BLUE’ from Properties Window.
  • Then select ‘Command 5 box’ from Form Window and select ‘Caption’ from Properties Window
  • Then replace ‘Command 5’ to ‘EXIT’ from Properties Window.

background color project
background-color-project

background-color-project

background-color-project

Step 4: –

Code Writing:-

  • Double click on ‘RED button’ or ‘Command 1 box’
  • Then input code to Command 1 code box

Code: – Form1.Backcolor = vbRed

  • Then double click on ‘GREEN button’ or ‘Command 2 box’
  • Then input code to Command 2 code box.

Code: – Form1.Backcolor = vbGreen

  • Then double click on ‘BLACK button’ or ‘Command 3 box’
  • Then input code to Command 3 code box.

Code: – Form1.Backcolor = vbBlack

  • Then double click on ‘BLUE button’ or ‘Command 4 box’
  • Then input code to Command 4 code box.

 

Code: – Form1.Backcolor = vbBlue

  • Then double click on ‘EXIT button’ or ‘Command 5 box’
  • Then input code to Command 5 code box.

Code: – End

code for Color Handling for Visual Basic

  • Then close code box

Step 5: –

Project Save: –

  • Click on ‘Save project’ option from File menu
  • Then input any name to file name box and click on Save option from Save file as box
  • Then input any new name to file name box
  • Then click ‘Save’ option.

Step 6: –

Project Run: –

  • Press F5 key from keyboard or click on ‘Start’ from ‘Run menu’ for run the project
  • Then click on ‘RED’/ ‘GREEN’/ ‘BLACK’/ ‘BLUE’ box and display Background Color.

background-color-project

  • Then click on ‘Exit Button’ for close the result window.

So this is the simple way to create a program in VB to insert window Background colour.






Related Posts:

One Response

  1. Jim
    |

    I appreciate your Program