Langkah 1 : Membuat desain form
Buat form baru dengan cara klik file ( new ( project ( pilih windows form application ( ok
Buatlah desain atau tampilan program seperti gambar diatas.
Langkah 2 : Memberi nilai pada properti kompoen
Klik pada komponen yang akan diberi nilai.
Masukkan nilai berikut pada properti masing – masing.
Langkah 3 : Listing code
Klik pada view ( code, atau mengunakan shortcut F7
Masukkan code berikut ini.
Public Class Form1
Public luas As Double
Public panjang As Double
Public lebar As Double
Public keliling As Double
Public operation As Byte
Public hasila As Double
Private Sub btnhapus_Click(sender As Object, e As EventArgs) Handles btnhapus.Click
txtkeliling.Text = ""
txtluas.Text = ""
txtlebar.Text = ""
txtpanjang.Text = ""
End Sub
Private Sub btnhitung_Click(sender As Object, e As EventArgs) Handles btnhitung.Click
If operation = "1" Then
keliling = 2 * Double.Parse(txtpanjang.Text) + 2 * Double.Parse(txtlebar.Text)
txtkeliling.Text = keliling
ElseIf operation = "2" Then
luas = Double.Parse(txtpanjang.Text) * Double.Parse(txtlebar.Text)
txtluas.Text = luas
ElseIf operation = "3" Then
hasila = Double.Parse(txtkeliling.Text) / 2
panjang = hasila - Double.Parse(txtlebar.Text)
txtpanjang.Text = panjang
ElseIf operation = "4" Then
hasila = Double.Parse(txtkeliling.Text) / 2
lebar = hasila - Double.Parse(txtpanjang.Text)
txtlebar.Text = lebar
End If
End Sub
Private Sub rbluas_Click(sender As Object, e As EventArgs) Handles rbluas.Click
operation = 2
End Sub
Private Sub rbkeliling_Click(sender As Object, e As EventArgs) Handles rbkeliling.Click
operation = 1
End Sub
Private Sub rbpanjang_Click(sender As Object, e As EventArgs) Handles rbpanjang.Click
operation = 3
End Sub
Private Sub rblebar_Click(sender As Object, e As EventArgs) Handles rblebar.Click
operation = 4
End Sub
End Class
Langkah 4 : Debugging
Untuk memulai menjalankan software klik Debug ( Start Debugging atau dengan shortcut F5
Jika tidak terjadi masalah berarti anda telah sukses membuat nya.
Download Instaler software nya di sini.
Related Posts :
- Back to Home »
- source code , vb.net »
- Membuat software pehitungan persegi panjang