Tuesday, February 8, 2011

Visual Basic 6.0 - Session 5


•  Add a new menu heading Selections with two subheadings, Binary Selection and Multiway Selection.  

Visual Basic 6.0 - Session 4

Create a calculator that can add, subtract, multiply and divide two numbers given by the user. A possible solution might use two input boxes (txtOne and txtTwo) and a label to display the answer (lblAnswer).

Declare  variables:
      dblNo1 As Double
      dblNo2 As Double
      dblAnswer As Double
      intError As Integer

Visual Basic 6.0 - Session 3

Message and Input Boxes
Message and input boxes are intrinsic functions in Visual Basic 6.0 which allow the end
user to interact with the program.

Follow the instructions Add new form to menu  at the end of session 1  to create a new form with a menu heading on the main form.  Call this “Message and Input Boxes”
•  Make the Form.Caption = “Message and Input Boxes”
•  Put a label on the top of the form  “Computer Conversation”.  Underneath have a command button with the caption “Talk to me!”  Name the command button cmdTalk.
•  Double click the command button to add the following code sequence.

Monday, February 7, 2011

Visual Basic 6.0 - Session 2

1. Open a new form and change its name to ColourChanger.  Place the following objects on this form.
  •  A heading label2 (Caption = Colour Changer)
  •  3 horizontal scroll bars (Set the max value property of all three to 255)
  •  3 other labels (2red, 3Green, 4Blue)
  •  a command button to quit the form (Caption = Return)
  •  another small label5 under the button with its visible property set to false.

Visual Basic 6.0 - Session 1

•  Open VisualBasic 6.0
•  Use the file menu to open a new project with a blank form.
•  Use the properties window to set
  • Main.frm as the form name.
  • My programs as the caption.
  • BackColor to White.
  • BorderStyle to Fixed Single.
  • WindowState to Maximised.