It is too nice to know the difference in coding between JAVA and VB.See the same program i did in JAVA.
Refer Four Calculations-Floating no also , 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 |
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:
Post a Comment