buble

Minggu, 18 Maret 2012

Aplikasi sederhana menggunakan VB






Aplikasi ini digunakan dalam penjualan Blackberry

cara penggunaannya :

Pertama yaitu dengan cara menginput kode jenis Blackberry yang ingin di beli
lalu klik OK


Selanjutnya jangan lupa memilih tipe BB,jika tipe belum di pilih akan keluar tampilan seperti dibawah ini ;









lalu,utuk mengetahui total biaya dan hasil maka tinggal klik Result seperti tampilan dibawah



Dan yang terakhir jika ingin keluar dari program klik Exit


Source code :

Public Class Form1


    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    End Sub
    
  


    Private Sub buatpil_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles hasil.Click
        jenis.Enabled = True
        harga.Enabled = True
        tagihan.Enabled = True
        diskon.Enabled = True
        jenis.Enabled = True


        If wifi.Checked = True Then
            jenis.Text = wifi.Text
        ElseIf threeG.Checked = True Then
            jenis.Text = threeG.Text


        Else
            MsgBox("Belum ada pilihan", MsgBoxStyle.Critical, "TAK ADA PILIHAN")
        End If


        Select Case jenis.Text


            Case Is = "wifi"
                harga.Text = 3850000
            Case Is = "ThreeG"
                harga.Text = 4800000


            Case Else


        End Select
        tagihan.Text = harga.Text


        If tagihan.Text >= 3500000 Then
            diskon.Text = tagihan.Text * 0.05
        Else
            diskon.Text = 0
        End If


        total.Text = tagihan.Text - diskon.Text
    End Sub


   


    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim y As Integer
        y = MsgBox("Are you sure?", MsgBoxStyle.YesNo + MsgBoxStyle.Question, "konfirmasi")
        If y = vbYes Then
            Me.Close()
        End If
    End Sub


    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        jenis.Text = ""
        harga.Text = ""
        tagihan.Text = ""
        diskon.Text = ""
        total.Text = ""
        jenis.Focus()
    End Sub
    


    Private Sub TextBox1_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles jenis.LostFocus
        Dim x As String
        Dim z As Integer
        z = Strings.Mid(TextBox1.Text, 2)
        tagihan.Text = Strings.FormatCurrency(z)
        x = Strings.Left(TextBox1.Text, 1)
        If x = "B" Then
            TextBox1.Text = "Bold"
        ElseIf x = "C" Then
            TextBox1.Text = "Curve"
        ElseIf x = "P" Then
            TextBox1.Text = "Pearl"
        ElseIf x = "T" Then
            TextBox1.Text = "Torch"
        Else
            TextBox1.Text = "Kode Salah"
        End If
    End Sub
    Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
        Dim c As String
        c = InputBox("Masukan Kode BB (Bold,Curve,Pearl,Torch)")
        TextBox1.Text = Strings.UCase(c)
    End Sub
End Class

Tidak ada komentar:

Posting Komentar