Create a form with
1 text boxe , 1 Label , And 4 command buttons.
FROM DESNGN:
Label box properties…………..
Caption:- Conversion
Value Is
Command buttons properties…………..
Command buttons 1 - Caption: Conversion to farenheight conversion
Command buttons 2 - Caption: Farenheight
to farenheight conversion
Command buttons 3 - Caption: Centigrade to roomer conversion
Command buttons 4 - Caption: Centigrade to Kelvin conversion
Add the following code to the form code module for the ‘Form1’
_Click event:
Program code:
Private Sub Command1_Click()
Dim centigrade, Farenheight
centigrade = InputBox("Enter The value of Centigrade
temperature")
Farenheit = (9 * centigreat) / 5 + 32
Text1 = Farenheit
End Sub
Private Sub Command2_Click()
Dim centigrade, Farenheight
Farenheit = InputBox("Enter The value of Centigrade
temperature")
centigrade = (5 * (Farenheit - 32)) / 9
Text1 = centigrade
End Sub
Private Sub Command3_Click()
Dim centigreat, romar
centigrade = InputBox("Enter The value of Centigrade
temperature")
romar = (4 * centigrade) / 5
Text1 = romar
End Sub
Private Sub Command4_Click()
Dim centigrade, kalvin
centigrade = InputBox("Enter The value of Centigrade
temperature")
kalvin = (5 * centigrade) / 5 + 273
Text1 = kalvin
End Sub
……………………………………..…
No comments:
Post a Comment