Senin, 10 April 2017

Tugas MDI


KODINGNYA :

Public Class Form1

    Private Sub PenjualanToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles PenjualanToolStripMenuItem.Click
        Form2.Show()
        Form2.MdiParent = Me
    End Sub

    Private Sub CloseToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles CloseToolStripMenuItem.Click
        Close()
    End Sub
End Class






Public Class Form2
    Dim total, harga As Integer
    Private Sub Form2_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        Label1.Text = "Jenis"
        Label2.Text = "Merk"
        Label3.Text = "Harga"
        Label4.Text = "Jumlah Beli"
        Label5.Text = "Total Harga"
        Button1.Text = "OK"
        ComboBox1.Items.Add("BAJU")
        ComboBox1.Items.Add("CELANA")
        ComboBox1.Items.Add("JAKET")
        Me.ContextMenuStrip = ContextMenuStrip1
    End Sub

    Private Sub ComboBox1_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox1.SelectedIndexChanged
        ComboBox2.Items.Clear()

        Select Case ComboBox1.Text
            Case "BAJU"
                ComboBox2.Items.Add("RA JEANS")
                ComboBox2.Items.Add("BLACK ID")
                ComboBox2.Items.Add("CROOZ")
            Case "CELANA"
                ComboBox2.Items.Add("JEANS")
                ComboBox2.Items.Add("JOGGER")
                ComboBox2.Items.Add("CARGO")
            Case "JAKET"
                ComboBox2.Items.Add("ARMY")
                ComboBox2.Items.Add("SWEATER")
                ComboBox2.Items.Add("BLEAZER")
        End Select
    End Sub

    Private Sub ComboBox2_SelectedIndexChanged(sender As Object, e As EventArgs) Handles ComboBox2.SelectedIndexChanged
        Select Case ComboBox2.Text
            Case "RA JEANS"
                TextBox1.Text = 100000
            Case "BLACK ID"
                TextBox1.Text = 200000
            Case "CROOZ"
                TextBox1.Text = 150000
            Case "JEANS"
                TextBox1.Text = 300000
            Case "JOGGER"
                TextBox1.Text = 150000
            Case "CARGO"
                TextBox1.Text = 200000
            Case "ARMY"
                TextBox1.Text = 400000
            Case "SWEATER"
                TextBox1.Text = 350000
            Case "BLEAZER"
                TextBox1.Text = 250000
        End Select
    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
        TextBox3.Text = (TextBox1.Text * TextBox2.Text)
    End Sub

    Private Sub Button2_Click(sender As Object, e As EventArgs)
       
    End Sub

    Private Sub Button3_Click(sender As Object, e As EventArgs)

    End Sub

    Private Sub YaToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles YaToolStripMenuItem.Click
        ComboBox1.Text = ""
        ComboBox2.Text = ""
        TextBox1.Text = ""
        TextBox2.Text = ""
        TextBox3.Text = ""
    End Sub
End Class

0 komentar:

Posting Komentar