Nama : Ahmad Dedy Setiawan
Nim : 161011400347
kelas : 04TPLP002
HASIL RUN 1
HASIL RUN 2 ( cetak
struk )
CODING
Imports word = Microsoft.Office.Interop.Word
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
TextBox4.Text = TextBox2.Text *
TextBox3.Text
End Sub
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
End Sub
Private Sub Label6_Click(sender As Object, e As EventArgs)
End Sub
Private Sub TextBox6_TextChanged(sender As Object, e As EventArgs)
End Sub
Private Sub PictureBox1_Click(sender As Object, e As EventArgs) Handles PictureBox1.Click
End Sub
Private Sub TextBox5_TextChanged(sender As Object, e As EventArgs) Handles
TextBox5.TextChanged
End Sub
Private Sub TextBox8_TextChanged(sender As Object, e As EventArgs)
End Sub
Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
tb_kendaraan.Text = TextBox10.Text *
TextBox11.Text
End Sub
Private Sub Button3_Click(sender As Object, e As EventArgs) Handles Btntambah.Click
TextBox5.Text = Val(tb_kendaraan.Text)
+ Val(TextBox4.Text) + Val(TextBox8.Text)
End Sub
Private Sub Button3_Click_1(sender As Object, e As EventArgs) Handles Button3.Click
TextBox8.Text = TextBox13.Text *
TextBox9.Text
End Sub
Private Sub Form1_BackgroundImageChanged(sender As Object, e As EventArgs)
End Sub
Private Sub Button4_Click(sender As Object, e As EventArgs) Handles Button4.Click
Dim aplikasi As New word.Application
Dim file As New word.Document
file = aplikasi.Documents.Open("C:\Users\ads\Documents\Custom Office
Templates\struk1.dotx")
file.Bookmarks("kendaraan").Select()
aplikasi.Selection.TypeText(tb_kendaraan.Text)
file.Bookmarks("makanan").Select()
aplikasi.Selection.TypeText(TextBox4.Text)
file.Bookmarks("minuman").Select()
aplikasi.Selection.TypeText(TextBox8.Text)
file.Bookmarks("total").Select()
aplikasi.Selection.TypeText(TextBox5.Text)
file.Bookmarks("tanggal").Select()
aplikasi.Selection.TypeText(dtp_tanggal.Text)
file.SaveAs2("C:\Users\ads\Documents\Custom Office Templates\struk
steam\struk.dotx")
aplikasi.Visible = True
End Sub
Private Sub TextBox7_TextChanged(sender As Object, e As EventArgs) Handles
tb_kendaraan.TextChanged
End Sub
Private Sub PictureBox2_Click(sender As Object, e As EventArgs) Handles PictureBox2.Click
End Sub
Private Sub CheckBox7_MouseClick(sender As Object, e As MouseEventArgs) Handles
CheckBox7.MouseClick
PictureBox2.Image = System.Drawing.Image.FromFile("D:\kuliah orang\gambar\images (11).jpeg")
TextBox12.Text = " BUS "
TextBox11.Text = "250.000"
CheckBox7.Checked = True
CheckBox6.Checked = False
CheckBox2.Checked = False
End Sub
Private Sub CheckBox6_MouseClick(sender As Object, e As MouseEventArgs) Handles
CheckBox6.MouseClick
PictureBox2.Image = System.Drawing.Image.FromFile("D:\kuliah orang\gambar\images (12).jpeg")
TextBox12.Text = " MOBIL "
TextBox11.Text = "100.000"
CheckBox7.Checked = False
CheckBox6.Checked = True
CheckBox2.Checked = False
End Sub
Private Sub CheckBox2_MouseClick(sender As Object, e As MouseEventArgs) Handles
CheckBox2.MouseClick
PictureBox2.Image = System.Drawing.Image.FromFile("D:\kuliah orang\gambar\images (13).jpeg")
TextBox12.Text = " MOTOR "
TextBox11.Text = "50.000"
CheckBox7.Checked = False
CheckBox6.Checked = False
CheckBox2.Checked = True
End Sub
Private Sub CheckBox9_MouseClick(sender As Object, e As MouseEventArgs) Handles
CheckBox9.MouseClick
PictureBox3.Image = System.Drawing.Image.FromFile("D:\kuliah orang\gambar\images (14).jpeg")
TextBox14.Text = " ICE SWEET TEA "
TextBox13.Text = "5.000"
CheckBox1.Checked = False
CheckBox8.Checked = False
CheckBox9.Checked = True
End Sub
Private Sub CheckBox8_MouseClick(sender As Object, e As MouseEventArgs) Handles
CheckBox8.MouseClick
PictureBox3.Image = System.Drawing.Image.FromFile("D:\kuliah orang\gambar\images (15).jpeg")
TextBox14.Text = " AIR PUTIH "
TextBox13.Text = "3.000"
CheckBox1.Checked = False
CheckBox9.Checked = False
CheckBox8.Checked = True
End Sub
Private Sub CheckBox1_MouseClick(sender As Object, e As MouseEventArgs) Handles
CheckBox1.MouseClick
PictureBox3.Image = System.Drawing.Image.FromFile("D:\kuliah
orang\gambar\jus-buah_20160611_194754.jpg")
TextBox14.Text = " JUS "
TextBox13.Text = "20.000"
CheckBox8.Checked = False
CheckBox9.Checked = False
CheckBox1.Checked = True
End Sub
Private Sub CheckBox3_MouseClick(sender As Object, e As MouseEventArgs) Handles
CheckBox3.MouseClick
PictureBox1.Image = System.Drawing.Image.FromFile("D:\kuliah orang\gambar\images (8).jpeg")
TextBox1.Text = " NASI GORENG "
TextBox2.Text = "10.000"
CheckBox5.Checked = False
CheckBox4.Checked = False
CheckBox3.Checked = True
End Sub
Private Sub CheckBox4_MouseClick(sender As Object, e As MouseEventArgs) Handles
CheckBox4.MouseClick
PictureBox1.Image = System.Drawing.Image.FromFile("D:\kuliah orang\gambar\images (9).jpeg")
TextBox1.Text = " MIE AYAM "
TextBox2.Text = "15.000"
CheckBox5.Checked = False
CheckBox4.Checked = True
CheckBox3.Checked = False
End Sub
Private Sub CheckBox5_MouseClick(sender As Object, e As MouseEventArgs) Handles
CheckBox5.MouseClick
PictureBox1.Image = System.Drawing.Image.FromFile("D:\kuliah orang\gambar\images (10).jpeg")
TextBox1.Text = " BASO "
TextBox2.Text = "20.000"
CheckBox5.Checked = True
CheckBox4.Checked = False
CheckBox3.Checked = False
End Sub
Private Sub CheckBox1_CheckedChanged(sender As Object, e As EventArgs) Handles
CheckBox1.CheckedChanged
End Sub
End Class
Tidak ada komentar:
Posting Komentar