Sabtu, 05 September 2015

Program VB Konversi Meter

Pada kesempatan kali ini admin akan memberikan contoh mengenai program Konversi Meter pada VB dengan menggunakan For Next, Until, While Do

Contoh Pict :



Codingnya :
Private Sub Command1_Click()
x = Val(Text1)
Picture1.Print "Meter", "Kilometer", "Centimeter", "Feet/kaki", "Mile/Mil"
For r = Text1 To Text2
k = x * 0.001
c = x * 100
f = x * 0.3048
m = x * 1.6093
Picture1.Print x, k, c, f, m
x = x + 1
Next r
End Sub

Private Sub Command2_Click()
Picture1.Cls
x = Val(Text2)
Picture1.Print "Meter", "Kilometer", "Centimeter", "Feet/kaki", "Mile/Mil"
Do
k = x * 0.001
c = x * 100
f = x * 0.3048
m = x * 1.6093
Picture1.Print x, k, c, f, m
x = x - 1
Loop Until x < Val(Text1)
End Sub

Private Sub Command3_Click()
Picture1.Cls
x = Val(Text1)
Picture1.Print "Meter", "Kilometer", "Centimeter", "Feet/kaki", "Mile/Mil"
While x <= Val(Text2)
k = x * 0.001
c = x * 100
f = x * 0.3048
m = x * 1.6093
Picture1.Print x, k, c, f, m
x = x + 1
Wend
End Sub

0 komentar:

Posting Komentar

 
;