Tuesday, December 11, 2007

How to work with Select Case in this example

How to work with Select Case in this example

To work with Select Case in this example

This Visual Basic language is used in this example. Depending on the text of Text1, Text3 will display the result of the mathematical calculation based on formulas of 'c' in different cases:

d = 20

a = Val(Text1.Text)

b = Val(Text2.Text)

Select Case a

Case 1

c = d * b

Case 2

c = d + b

Case 3

c = d / b

Case 4

c = d - b

End Select

Text3.Text = c


No comments: