0% found this document useful (0 votes)
42 views3 pages

Tugas Pertemuan 4 Visual Basic II

This document summarizes steps for a programming visual project in Visual Studio: 1. Open Visual Studio and create a new project and design 2. Add controls like buttons, dropdowns and textboxes to the design 3. Add coding to assign functionality to the controls like clearing fields when a button is clicked or populating a dropdown list. The coding also calculates costs and profits when an item is selected. 4. Run the project to see the results.

Uploaded by

Fitri Najila
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
42 views3 pages

Tugas Pertemuan 4 Visual Basic II

This document summarizes steps for a programming visual project in Visual Studio: 1. Open Visual Studio and create a new project and design 2. Add controls like buttons, dropdowns and textboxes to the design 3. Add coding to assign functionality to the controls like clearing fields when a button is clicked or populating a dropdown list. The coding also calculates costs and profits when an item is selected. 4. Run the project to see the results.

Uploaded by

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

Nama : Fitri Najila

Kelas : SI-XW 41/19


Npm : 19402012

PERTEMUAN 4 PEMROGRAMAN VISUAL


1. Buka visual studio
 Buat project
 Buat design

 Masukan Coding
 Hasil

Source Code

Public Class Form1

Private Sub Btn_del_Click(sender As Object, e As EventArgs) Handles Btn_del.Click


cb_barang.Text = ""
txt_beli.Text = ""
txt_jual.Text = ""
txt_laba.Text = ""
End Sub

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load


cb_barang.Items.Clear()
cb_barang.Items.Add("Terigu")
cb_barang.Items.Add("Beras")
cb_barang.Items.Add("Mi Instan")
cb_barang.Items.Add("Rokok")
cb_barang.Items.Add("Susu")
End Sub

Private Sub Btn_exit_Click(sender As Object, e As EventArgs) Handles Btn_exit.Click


Btn_exit.Text = MsgBox("Anda Ingin Keluar Aplikasi ?", vbQuestion + vbOKCancel,
"Info")
If Btn_exit.Text = vbOK Then
End
End If
End Sub

Private Sub cb_barang_SelectedIndexChanged(sender As Object, e As EventArgs) Handles


cb_barang.SelectedIndexChanged
If cb_barang.SelectedIndex = 0 Then
txt_beli.Text = 10000
txt_jual.Text = Val(txt_beli.Text) + Val(txt_beli.Text * 0.05)
txt_laba.Text = Val(txt_jual.Text) - Val(txt_beli.Text)
ElseIf cb_barang.SelectedIndex = 1 Then
txt_beli.Text = 50000
txt_jual.Text = Val(txt_beli.Text) + Val(txt_beli.Text * 0.1)
txt_laba.Text = Val(txt_jual.Text) - Val(txt_beli.Text)
ElseIf cb_barang.SelectedIndex = 2 Then
txt_beli.Text = 5000
txt_jual.Text = Val(txt_beli) + Val(txt_beli.Text * 0.5)
txt_laba.Text = Val(txt_jual.Text) - Val(txt_beli.Text)
ElseIf cb_barang.SelectedIndex = 3 Then
txt_beli.Text = 25000
txt_jual.Text = Val(txt_beli) + Val(txt_beli.Text * 0.5)
txt_laba.Text = Val(txt_jual.Text) - Val(txt_beli.Text)
ElseIf cb_barang.SelectedIndex = 4 Then
txt_beli.Text = 50000
txt_jual.Text = Val(txt_beli) + Val(txt_beli.Text * 0.05)
txt_laba.Text = Val(txt_jual.Text) - Val(txt_beli.Text)
Else
MsgBox("Gak Ada Pilihan")
End If
End Sub
End Class

You might also like