100% found this document useful (1 vote)
51 views4 pages

Nama: Andi Kurniawan Nim: 03021281419102 Jurusan: Teknikpertambangan

This document provides instructions for creating two forms in Visual Basic. Form 1 allows the user to select a shift and cashier from drop-down menus. When the button is clicked, it opens Form 2 and passes the selected cashier. Form 2 displays textboxes to enter room rate, nights stayed, amount paid, and change due. It automatically calculates totals based on user input. The final instructions say to run the program and test the form interactions and calculations.

Uploaded by

Ripin Kaka
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
51 views4 pages

Nama: Andi Kurniawan Nim: 03021281419102 Jurusan: Teknikpertambangan

This document provides instructions for creating two forms in Visual Basic. Form 1 allows the user to select a shift and cashier from drop-down menus. When the button is clicked, it opens Form 2 and passes the selected cashier. Form 2 displays textboxes to enter room rate, nights stayed, amount paid, and change due. It automatically calculates totals based on user input. The final instructions say to run the program and test the form interactions and calculations.

Uploaded by

Ripin Kaka
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Nama

: Andi Kurniawan
Nim
: 03021281419102
Jurusan : TeknikPertambangan

Untuk Form 1 :
1. Isikan form dengan
Label, Textbox , Comboboxdan Button sebanyak yang
kitaperlukan
2. Isi kodingsesuai yang kitainginkanseperti :
PublicClassForm1
PrivateSub Label1_Click(ByVal sender AsSystem.Object, ByVal e AsSystem.EventArgs) Handles
Label1.Click
EndSub
PrivateSub ComboBox1_SelectedIndexChanged(ByVal sender AsSystem.Object,
AsSystem.EventArgs) Handles ComboBox1.SelectedIndexChanged

ByVal

EndSub
PrivateSub Form1_Load(ByVal sender AsSystem.Object,
HandlesMyBase.Load
ComboBox1.Items.Add("08.00 - 16.00")
ComboBox1.Items.Add("16.00 - 24.00")
ComboBox1.Items.Add("00.00 - 08.00")
ComboBox2.Items.Add("Kudir")
ComboBox2.Items.Add("Andi Kurniawan")
ComboBox2.Items.Add("Juminten")
EndSub

ByVal

AsSystem.EventArgs)

PrivateSub ComboBox2_SelectedIndexChanged(ByVal sender AsSystem.Object,


AsSystem.EventArgs) Handles ComboBox2.SelectedIndexChanged

ByVal

EndSub
PrivateSub Button1_Click(ByVal sender AsSystem.Object, ByVal e AsSystem.EventArgs) Handles
Button1.Click
Form2.Show()
Me.Hide()
Form2.Label6.Text = ("by " + Me.ComboBox2.Text)
EndSub
EndClass

3. Laluisikan form sesuai yang kitainginkansaat program dijalankan , untuk shift dan
cashier kitahanyaperlumemilihapa yang adadisitu
4. Jikatelahselesaiklik next untuklanjutke form selanjutnya
Untuk Form 2 :
1. Buatlah Label , Textbox , Button , danGroupbox
2. Isi kodingsepertiini :
PublicClassForm2
PrivateSub Label6_Click(ByVal sender AsSystem.Object, ByVal e AsSystem.EventArgs) Handles
Label6.Click
EndSub
PrivateSub Button2_Click(ByVal sender AsSystem.Object, ByVal e AsSystem.EventArgs) Handles
Button2.Click
MsgBox("Anda Yakin ?", vbOKCancel, "Close")
IfMsgBoxResult.OkThen
End
EndIf

EndSub
PrivateSub GroupBox2_Enter(ByVal sender AsSystem.Object, ByVal e AsSystem.EventArgs)
Handles GroupBox2.Enter
EndSub
PrivateSub Button1_Click(ByVal sender AsSystem.Object, ByVal e AsSystem.EventArgs) Handles
Button1.Click
Form1.Show()
Form1.TextBox1.Text = ""
Form1.TextBox2.Text = ""
Form1.ComboBox1.Text = ""
Form1.ComboBox2.Text = ""
Me.Hide()
EndSub

PrivateSub TextBox2_TextChanged(ByVal sender AsSystem.Object, ByVal e AsSystem.EventArgs)


Handles TextBox2.TextChanged
EndSub
PrivateSub TextBox3_TextChanged(ByVal sender AsSystem.Object, ByVal e AsSystem.EventArgs)
Handles TextBox3.TextChanged
EndSub
PrivateSub TextBox1_TextChanged(ByVal sender AsSystem.Object, ByVal e AsSystem.EventArgs)
Handles TextBox1.TextChanged
TextBox2.Text = Val(250000)
TextBox3.Text = Val(TextBox1.Text * TextBox2.Text)
EndSub

PrivateSub TextBox4_TextChanged(ByVal sender AsSystem.Object, ByVal e AsSystem.EventArgs)


Handles TextBox4.TextChanged
TextBox5.Text = Val(TextBox4.Text - TextBox3.Text)
EndSub
PrivateSub Form2_Load(ByVal
HandlesMyBase.Load

sender

AsSystem.Object,

ByVal

AsSystem.EventArgs)

EndSub
EndClass

3. Jalankan
program
,
untuk
Lama
Menginapdiinputoleh
user
,
sedangkanhargasewaperhariditetapkansebagai
250000
rupiah
danbiayasewakamarakanterhitungsendiriketika lama menginaptelahdiisi
4. Untukjumlahbayardiisioleh
user
danbiayakembaliakanterisidengansendiriketikajumlahbayartelahterisi
5. Padabagian new user akanmengulanguntukmengisilagike form 1 sedangkanpada
close user akanmenutup program tersebut

You might also like