· [FONT="][/FONT] [FONT="] [/FONT] [FONT="]Code :[/FONT][FONT="][/FONT] [FONT="]Private Sub btnchuyen1_Click[/FONT][FONT="](ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnchuyen1.Click[/FONT] [FONT="] If lstmonhoc.SelectedIndex <> -1 Then[/FONT] [FONT="] lstnhan.Items.Add(lstmonhoc.Text)[/FONT] [FONT="] lstmonhoc.Items.RemoveAt(lstmonhoc.SelectedIndex)[/FONT] [FONT="] Else[/FONT] [FONT="] MsgBox("Bạn chưa chọn thì làm sao mà chuyển được ! ", MsgBoxStyle.Information, " Thông Báo khẩn ")[/FONT] [FONT="] End If[/FONT] [FONT="] End Sub[/FONT] [FONT="] [/FONT] [FONT="] Private Sub bttnchuyenhet_Click[/FONT][FONT="](ByVal sender As System.Object, ByVal e As System.EventArgs) Handles bttnchuyenhet.Click[/FONT] [FONT="] For i As Integer = 0 To lstmonhoc.Items.Count - 1[/FONT] [FONT="] lstnhan.Items.Add(lstmonhoc.Items(i))[/FONT] [FONT="] Next[/FONT] [FONT="] lstmonhoc.Items.Clear()[/FONT] [FONT="] End Sub[/FONT] [FONT="] [/FONT] [FONT="] Private Sub btnlai1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnlai1.Click[/FONT] [FONT="] If lstnhan.SelectedIndex <> -1 Then[/FONT] [FONT="] lstmonhoc.Items.Add(lstnhan.Text)[/FONT] [FONT="] lstnhan.Items.RemoveAt(lstnhan.SelectedIndex)[/FONT] [FONT="] Else[/FONT] [FONT="] MsgBox("Bạn chưa chọn thì làm sao mà chuyển được ! ", MsgBoxStyle.Information, " Thông Báo khẩn ")[/FONT] [FONT="] End If[/FONT] [FONT="] End Sub[/FONT] [FONT="] [/FONT] [FONT="] Private Sub btnquahet_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnquahet.Click[/FONT] [FONT="] For i As Integer = 0 To lstnhan.Items.Count - 1[/FONT] [FONT="] lstmonhoc.Items.Add(lstnhan.Items(i))[/FONT] [FONT="] Next[/FONT] [FONT="] lstnhan.Items.Clear()[/FONT] [FONT="] End Sub[/FONT] [FONT="] [/FONT] [FONT="] Private Sub btnhocphi_Click[/FONT][FONT="](ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnhocphi.Click[/FONT] [FONT="] Dim chiphi As Integer = 0[/FONT] [FONT="] For i As Integer = 0 To lstnhan.Items.Count - 1[/FONT] [FONT="] If lstnhan.Items(i) = "Anh văn 1" Then[/FONT] [FONT="] chiphi = chiphi + 4 * 100000[/FONT] [FONT="] End If[/FONT] [FONT="] If lstnhan.Items(i) = "Tin Học" Then[/FONT] [FONT="] chiphi = chiphi + 4 * 100000[/FONT] [FONT="] End If[/FONT] [FONT="] If lstnhan.Items(i) = "Triết Học" Then[/FONT] [FONT="] chiphi = chiphi + 6 * 100000[/FONT] [FONT="] End If[/FONT] [FONT="] If lstnhan.Items(i) = "Toán" Then[/FONT] [FONT="] chiphi = chiphi + 4 * 100000[/FONT] [FONT="] End If[/FONT] [FONT="] If lstnhan.Items(i) = "Anh Văn 2" Then[/FONT] [FONT="] chiphi = chiphi + 4 * 100000[/FONT] [FONT="] End If[/FONT] [FONT="] If lstnhan.Items(i) = "Kinh Tế Chính Trị" Then[/FONT] [FONT="] chiphi = chiphi + 5 * 100000[/FONT] [FONT="] End If[/FONT] [FONT="] If lstnhan.Items(i) = "Xác suất thống kê" Then[/FONT] [FONT="] chiphi = chiphi + 4 * 100000[/FONT] [FONT="] End If[/FONT] [FONT="] If lstnhan.Items(i) = "Pháp luật" Then[/FONT] [FONT="] chiphi = chiphi + 3 * 100000[/FONT] [FONT="] End If[/FONT] [FONT="] Next[/FONT] [FONT="] txtketqua.Text = chiphi[/FONT] [FONT="] End Sub[/FONT] [FONT="] [/FONT] [FONT="] Private Sub btnchen_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnchen.Click[/FONT] [FONT="] If lstmonhoc.SelectedIndex >= 0 Then[/FONT] [FONT="] lstmonhoc.Items.Insert(lstmonhoc.SelectedIndex, txtthaydoi.Text)[/FONT] [FONT="] Else[/FONT] [FONT="] lstmonhoc.Items.Insert(0, txtthaydoi.Text)[/FONT] [FONT="] End If[/FONT] [FONT="] End Sub[/FONT] [FONT="] [/FONT] [FONT="] Private Sub btnXoa_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnXoa.Click[/FONT] [FONT="] If lstmonhoc.SelectedIndex >= 0 Then[/FONT] [FONT="] lstmonhoc.Items.RemoveAt(lstmonhoc.SelectedIndex)[/FONT] [FONT="] End If[/FONT] [FONT="] End Sub[/FONT] [FONT="][/FONT] [FONT="] [/FONT] [FONT="] [/FONT] [FONT="] [/FONT] [FONT="] [/FONT] [FONT="] [/FONT] [FONT="] [/FONT] [FONT="] [/FONT] [FONT="] [/FONT] [FONT="] [/FONT] [FONT="] [/FONT] [FONT="] [/FONT] [FONT="] [/FONT] [FONT="]Nếu bạn muốn chọn cùng một lúc nhiếu cái thì ta sẽ thay đổi đoạn code 1 chút :[/FONT] [FONT="] [/FONT] [FONT="] Private Sub btnchuyen1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnchuyen1.Click[/FONT] [FONT="] If lstmonhoc.SelectedIndex >= 0 Then[/FONT] [FONT="] For i As Integer = 0 To lstmonhoc.Items.Count - 1[/FONT] [FONT="] If lstmonhoc.GetSelected(i) = True Then[/FONT] [FONT="] lstnhan.Items.Add(lstmonhoc.Items.Item(i))[/FONT] [FONT="] End If[/FONT] [FONT="] Next[/FONT] [FONT="] For i As Integer = lstmonhoc.Items.Count - 1 To 0 Step -1[/FONT] [FONT="] If lstmonhoc.GetSelected(i) = True Then[/FONT] [FONT="] lstmonhoc.Items.RemoveAt(i)[/FONT] [FONT="] End If[/FONT] [FONT="] Next[/FONT] [FONT="] End If[/FONT] [FONT="] End Sub[/FONT] [FONT="] [/FONT] [FONT="] Private Sub btnlai1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnlai1.Click[/FONT] [FONT="] If lstnhan.SelectedIndex >= 0 Then[/FONT] [FONT="] For i As Integer = 0 To lstnhan.Items.Count - 1[/FONT] [FONT="] If lstnhan.GetSelected(i) = True Then[/FONT] [FONT="] lstmonhoc.Items.Add(lstnhan.Items.Item(i))[/FONT] [FONT="] End If[/FONT] [FONT="] Next[/FONT] [FONT="] For i As Integer = lstnhan.Items.Count - 1 To 0 Step -1[/FONT] [FONT="] If lstnhan.GetSelected(i) = True Then[/FONT] [FONT="] lstnhan.Items.RemoveAt(i)[/FONT] [FONT="] End If[/FONT] [FONT="] Next[/FONT] [FONT="] End If[/FONT] [FONT="] End Sub[/FONT]