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

Saturday, May 28, 2011

VB-15 : The four calculations



It is too nice to know the difference in coding between JAVA and VB.See the same program i did in JAVA. 

==============================================
B) Property :
Label       : NAME-Label1, CAPTION-Enter first number
Textbox   : NAME – text1   , Text-(should kept blank)
Label        : NAME-Label2, CAPTION-Enter second number
Textbox    : NAME – text2   , Text-(should kept blank)
OptionButton : NAME-Option1,CAPTION-Add
OptionButton : NAME-Option2,CAPTION-Subtract
OptionButton : NAME-Option3,CAPTION-Multiply
OptionButton : NAME-Option4,CAPTION-Devide
Command Button  :  NAME -  Command5, CAPTION-Exit


C) 
  Attaching Code to the Object :



Private Sub Command1_Click()
End
End Sub

Private Sub Option1_Click()
If Option1.Value Then
c = Val(Text1.Text) + Val(Text2.Text)
MsgBox c
End If
End Sub

Private Sub Option2_Click()
If Option2.Value Then
c = Val(Text1.Text) - Val(Text2.Text)
MsgBox c
End If
End Sub

Private Sub Option3_Click()
If Option3.Value Then
c = Val(Text1.Text) * Val(Text2.Text)
MsgBox c
End If
End Sub

Private Sub Option4_Click()
If Option4.Value Then
c = Val(Text1.Text) / Val(Text2.Text)
MsgBox c
End If
End Sub





Click   Simple Programs(3) to get an idea about Calculation.


 Refer Calculations using Grid control  & Simple Calculator also.



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

No comments: