Penyelesaian Menurut Saya:
1. Kita buat desain awalnya dulu, seperti ini:
Pada pertanyaan no 1, opt studio menggunakan array caranya, cukup pasangkan satu Option Button, kumudian klik kanan pada optionbutton cari coppy kemudian klik kanan paste-kan. maka akan ada peringakatan "do you alredy have a control name 'option1'.Do you wannt to create a control aray?". Klik Yes, maka anda akan mendapatkan option button aray lakukan sampai 3 kali.
2. Sekarang kita atur properties nya
label 1
caption: Studio:
label 2
caption:Judul Film :
label 3
caption: LblJudulFilm
label 4
caption:Jam Tayang :
label 5
caption:Hari :
label 6
caption: No Kursi :
label 7
caption:Total Harga : Rp
Frame2
Caption: Detail tiket
label 8
caption: Judul Film Pilihan
label 9
caption: Date :
label 10
caption: Kosongkan
Name:lblDate
label 11
caption: Time :
label 12
caption:kosongkan
name:lblTime
label 13
caption:Price : Rp.
label 14
caption:kosongkan
name:lblPrice
label 15
caption:Normat : Rp 20.000 (senin-kamis)
label 16
caption:Jumat : Rp 30.000
label 17
caption:HTM : Rp 45.000
option1(0) optionbutton
Name: OptStudio
Caption: Studio 1
option1(1) optionbutton
Name: OptStudio
Caption: Studio 2
option1(2) optionbutton
Name: OptStudio
Caption: Studio 3
option1(3) optionbutton
Name: OptStudio
Caption: Studio 4
Combo1
Name:cmbJamTayang
List1
Name: LstHari
List2
Name:LstRow
Style: 1-Checkbox
List3
Name:LstSeat
Style: 1-Checkbox
Command1
Name: cmdBeli
Caption: Beli
Frame1
Caption: Pembayaran
Option2
Name:OptPembayaran
Option: Cash
option3
Name:OptCredit
Caption:Credit
Command2
Name: cmdCancel
Caption: Cancel
Command3
Name: cmdExit
Caption: Exit
maka Hasilnya akan seperti ini:
Untuk masalah tulisan dan ukuran tulisan bisa di sesuaikan dengan keinginan anda sendiri.
3. Sekarang Kita mulai membuat coding
Tampilkan judul film pada LblJudulFilm saat user memilih salah satu studio pada OptStudio2.Tampilkan pula jam tayang pada pada cboJamTayang berdasarkan studio yang dipilih user.Isi LstHari (Senin s/d Minggu), LstRow (A s/d J), LstSeat (1-10). Pada LstRow dan LstSeat, ganti property Style = 1-CheckBox. User dapat membeli banyak tiket
Private Sub OptStudio_Click(Index As Integer)
If OptStudio(0).Value = True Then
LblJudulFilm.Caption = "IRON MAN 2"
cmbJamTayang.List(0) = "14:45"
cmbJamTayang.List(1) = "17:00"
cmbJamTayang.List(2) = "19:15"
cmbJamTayang.List(3) = "21:30"
LstHari.List(0) = "Senin"
LstHari.List(1) = "Selasa"
LstHari.List(2) = "Rabu"
LstHari.List(3) = "Kamis"
LstHari.List(4) = "Jumat"
LstHari.List(5) = "Sabtu"
LstHari.List(6) = "Minggu"
LstRow.List(0) = "A"
LstRow.List(1) = "B"
LstRow.List(2) = "C"
LstRow.List(3) = "D"
LstRow.List(4) = "E"
LstRow.List(5) = "F"
LstRow.List(6) = "G"
LstRow.List(7) = "H"
LstRow.List(8) = "I"
LstRow.List(9) = "J"
For s = 1 To 10
LstSeat.AddItem s
Next
ElseIf OptStudio(1).Value = True Then
LblJudulFilm.Caption = "The Book of Eli"
cmbJamTayang.List(0) = "14:55 "
cmbJamTayang.List(1) = "17:05"
cmbJamTayang.List(2) = "19:15"
cmbJamTayang.List(3) = "21:25"
LstHari.List(0) = "Senin"
LstHari.List(1) = "Selasa"
LstHari.List(2) = "Rabu"
LstHari.List(3) = "Kamis"
LstHari.List(4) = "Jumat"
LstHari.List(5) = "Sabtu"
LstHari.List(6) = "Minggu"
LstRow.List(0) = "A"
LstRow.List(1) = "B"
LstRow.List(2) = "C"
LstRow.List(3) = "D"
LstRow.List(4) = "E"
LstRow.List(5) = "F"
LstRow.List(6) = "G"
LstRow.List(7) = "H"
LstRow.List(8) = "I"
LstRow.List(9) = "J"
For s = 1 To 10
LstSeat.AddItem s
Next
ElseIf OptStudio(2).Value = True Then
LblJudulFilm.Caption = "GREEN ZONE"
cmbJamTayang.List(0) = "14:25 "
cmbJamTayang.List(1) = "16:50"
cmbJamTayang.List(2) = "19:15"
cmbJamTayang.List(3) = "21:40"
LstHari.List(0) = "Senin"
LstHari.List(1) = "Selasa"
LstHari.List(2) = "Rabu"
LstHari.List(3) = "Kamis"
LstHari.List(4) = "Jumat"
LstHari.List(5) = "Sabtu"
LstHari.List(6) = "Minggu"
LstRow.List(0) = "A"
LstRow.List(1) = "B"
LstRow.List(2) = "C"
LstRow.List(3) = "D"
LstRow.List(4) = "E"
LstRow.List(5) = "F"
LstRow.List(6) = "G"
LstRow.List(7) = "H"
LstRow.List(8) = "I"
LstRow.List(9) = "J"
For s = 1 To 10
LstSeat.AddItem s
Next
ElseIf OptStudio(3).Value = True Then
LblJudulFilm.Caption = "HURT LOCKER"
cmbJamTayang.List(0) = "14:25 "
cmbJamTayang.List(1) = "16:50"
cmbJamTayang.List(2) = "19:15"
cmbJamTayang.List(3) = "21:40"
LstHari.List(0) = "Senin"
LstHari.List(1) = "Selasa"
LstHari.List(2) = "Rabu"
LstHari.List(3) = "Kamis"
LstHari.List(4) = "Jumat"
LstHari.List(5) = "Sabtu"
LstHari.List(6) = "Minggu"
LstRow.List(0) = "A"
LstRow.List(1) = "B"
LstRow.List(2) = "C"
LstRow.List(3) = "D"
LstRow.List(4) = "E"
LstRow.List(5) = "F"
LstRow.List(6) = "G"
LstRow.List(7) = "H"
LstRow.List(8) = "I"
LstRow.List(9) = "J"
For s = 1 To 10
LstSeat.AddItem s
Next
End If
End Sub
Saat user meng-klik cmdBeli, Tampilkan total harga pada txtTotHarga (total harga = jumlah tiket * harga tiket pada hari yang dipilih user). Pada FrmDetailTiket, tampilkan judul film pada LblJudulFilmPilih, tampilkan hari dan tanggal pada LblDate, tampilkan jam tayang yang dipilih user pada LblJamTayang, tampilkan harga tiket pada LblHarga berdasarkan harga pada hari yang dipilih user.
Sebelum itu kita inilisiasikan nilainyam klik general:
Dim harga, total, credit As Currency
Dim jumlah As Integer
Kemudian, tuliskan code ini
Private Sub cmdBeli_Click()
lblTime.Caption = cmbJamTayang
lblDate.Caption = LstHari
LblJuduFilmlPilihan.Caption = LblJudulFilm
jumlah = LstSeat
Select Case LstHari.ListIndex
Case 0, 1, 2, 3
harga = 20000
total = jumlah * harga
txtTotalHarga.Text = total
lblPrice.Caption = total
credit = (jumlah - 1) * harga
Case 4
harga = 30000
total = jumlah * harga
txtTotalHarga.Text = total
lblPrice.Caption = total
credit = (jumlah - 1) * harga
Case 5, 6
harga = 45000
total = jumlah * harga
txtTotalHarga.Text = total
lblPrice.Caption = total
credit = (jumlah - 1) * harga
End Select
End Sub
Munculkan message box “Jumlah uang yang harus dibayar” Pembayaran ada 2 jenis :
a. Jika user memilih OptCash, maka jumlah uang yang harus dibayar = total harga.
b. Jika user memilih OptCreditCard, maka berlaku buy 1 get 1 free tapi tidak berlaku kelipatan. Jumlah uang yang harus dibayar = total harga – ( (jumlah tiket-1) * harga tiket). Misal, beli 2 tiket, hanya bayar 1 tiket. Beli 4 tiket, hanya bayar 3 tiket.
Private Sub OptCredit_Click()
MsgBox "Total Harga Yang harus di bayarkan adalah " & vbNewLine & "Rp. " & credit, vbInformation, "Konfirmasi"
End Sub
Private Sub OptPembayaran_Click(Index As Integer)
MsgBox "Total Harga Yang harus di bayarkan adalah " & vbNewLine & "Rp. " & total, vbInformation, "Konfirmasi"
End Sub
Tombol cmdCancel digunakan untuk membatalkan transaksi (bersihkan form) dan tombol cmdExit digunakan untuk keluar dari program
Private Sub cmdCencel_Click()
OptStudio(0).Value = False
OptStudio(1).Value = False
OptStudio(2).Value = False
OptStudio(3).Value = False
LblJudulFilm.Caption = "LblJudulFilm"
LblJuduFilmlPilihan.Caption = "LblJuduFilmlPilihan"
cmbJamTayang.Clear
OptCredit.Value = False
OptPembayaran(0).Value = False
txtTotalHarga.Text = ""
lblDate.Caption = ""
lblTime.Caption = ""
lblPrice.Caption = ""
LstHari.Clear
LstRow.Clear
LstSeat.Clear
End Sub
Private Sub cmdExit_Click()
End
End Sub