Making Good GUI In VB6 Tutorial 1

Visual Basic Graphical User Interface (GUI)



Is your college first year project a vb6 project ? Are you stumbling to get a good presentable UI ? If so I can help you. I have always seen many projects made in VB6 are not even presentable

But sometimes VB6 can also do some surprising things.



The major work is done by Labels, Shapes, Fonts And The Background Image 
Today in this tutorial you will learn how to use an Label as Button in vb6.


Labels  

 
As i already said that Labels pay a big role in the gui, they help us by providing a flexible option to replace traditional buttons in vb6.

  Now, How to use a Label as a button ?
  1. Create a Label.
  2. Scale it in a rectangular shape (based on what content it is going to hold).
  3. Now change the font to a modern font like the Verdana or Segoe UI.
  4. Change the Font Size to a suitable size as it should be readable and suitable to the Lable's size.
  5. Select Alignment option in properties and set it to " 2 - Center ".
  6. Type the text that you want to appear on the face of the button in "Caption"
  7. Select BackColor option in the properties and use this colours by typing it. (Colours:- Red - &H006060FF& , Teal - &H00AAAA50& , Light Red - &H008080FF& , Light Teal - &H00BBBB50& (if you want it more light just change the 4 B to C or D)  or a grey - &H00808080& .
  8. Select ForeColor and set it to White - &H00FFFFFF& .
Now you are done with its non active layout. The button is done but it isn't working.
For making it work you have to do some additional steps. 
  1. Right click on the label or the button you have created and select View Code.
  2. Now from the Object list select your label and from the Procedure list select MouseMove.
  3. Now set the BackColor = (Light Red " &H008080FF& " or Light Teal " &H00BBBB50& " , based on which colour you choosed earlier.)
  4. Select Form from the Object list and MouseMove from Procedure list.
  5. Now set the BackColor = (Red " &H006060FF& " or Teal " &H00AAAA50& " , based on which colour you choosed earlier.)
Now you are done with the active button. You can improve it by assigning the MouseDown and MouseUp events a colour switch. You can make the Red more light by increasing both the 6.
Your code should look like this


 End of tutorial 1.
 
 

Comments