Walk Lightly on this PLANET and yet leave such a FOOTPRINT that cannot be erased for thousands of Years..!!!
Visit Codstech for Cyber Security related Posts !

Visitors

Monday, May 23, 2011

VB-4 : Testing MOVE



When we click “ Click Me  “, a message box will appear ,and “Close” will quit the application.

A)   Property :
Command Button 1  :  NAME -  Command1, CAPTION-Click Me
Command Button 2  :  NAME -  Command2, CAPTION-Close


B)   Attaching Code to the Object :
Private Sub Command1_Click()
Command1.Move 55, 87
Command1.Caption = "I am here"
End Sub

Private Sub Command2_Click()
End
End Sub



=========================================================================
Back to Home   &  VB

VB-3 : Message Program



When we click “ Display  “, a message box will appear “END” will stop the execution.

A)   Property :

Command Button 1  :  NAME -  Command1, CAPTION-Display
Command Button 2  :  NAME -  Command2, CAPTION-End


B)   Attaching Code to the Object :
Private Sub Command1_Click()
MsgBox "Hello"
End Sub
Private Sub Command2_Click()
End
End Sub
Private Sub Form_Load()
End Sub




=========================================================================
Back to Home   &  VB

VB-2 : Speed Program



When we move the scroll bar the km/hour changes from 1 to 100, and “STOP” will close the operation.
A)   
Property :
Textbox                    :   NAME – text1   , Text-(should kept blank)
Command Button 1  :  NAME -  Command1, CAPTION-Stop
Horizontal scroll bar :  min – 0, max-100

B)   Attaching Code to the Object :
Private Sub Command1_Click()
End
End Sub

Private Sub HScroll1_Change()
Text1.Text = Str(HScroll1.Value) + "km/hour"
End Sub
   Private Sub Text1_Change()
End Sub




=========================================================================
Back to Home   &  VB 

VB-1 : Welcome Program



When we click “Display”, welcome to VB will appear.
“Clear” will  clear the text box and “Close” will quit the application.

B) Property :
Textbox                    :   NAME – text1   , Text-(should kept blank)
Command Button 1  :  NAME -  Command1, CAPTION-Display
Command Button 2  :  NAME -  Command2, CAPTION-Clear
Command Button 3  :  NAME -  Command3, CAPTION-Close



C)   Attaching Code to the Object :

Private Sub Command1_Click()
Text1.Text = "Welcome to VB"
End Sub
   Private Sub Command2_Click()
Text1.Text = " "
End Sub
Private Sub Command3_Click()
Beep
End
End Sub


Tip :


There is a property called ToolTipText . If we write something here, we can see that as a caption while running  the program.
Example : Add the ToolTipText  property  for each command button for the above program,as given below :


 Property :
Command Button 1  :  NAME -  Command1, CAPTION-Display,ToolTipText : Display
Command Button 2  :  NAME -  Command2, CAPTION-Clear,ToolTipText : Clear
Command Button 3  :  NAME -  Command3, CAPTION-Close,ToolTipText : Close




While running the program , if we place the cursor near the first command button , we can see a caption as  Display , and Clear , Close etc can see as captions , while placing the mouse near Command Button 2, Command Button 3 respectively.
======================= 
Back to Home   &  VB 
=========================================================================