How to Create a Mini Cashiering System in VB.NET
In this tutorial, I will teach you how to create a mini cashiering system in vb.net. This application is very helpful as a basis especially if you have to create a simple project in school. This cashiering system can select products, have payment, and print receipts.
Creating Application
Step 1
Open Microsoft Visual Studio 2015 or higher version and create a new windows form application. After that do the form just like shown below.
The form above was build using the ff:
- Labels
- Textboxes
- Panels
- Buttons
Step 2
Add Column in the Data Grid View for "Item" and Price.Then double click the form and do the following code for adding the data in the datagridview.
- DataGridView1.Rows.Add("Chicken Wings", "100")
- DataGridView1.Rows.Add("Beff Tapa", "200")
- DataGridView1.Rows.Add("Chicken Adobo", "150")
- DataGridView1.Rows.Add("Pork Adobo", "170")
Step 3
Go back to the design view and click the datagridview. After that, go to the properties, select the event just like a lightning bolt and double click the click event handler
for datagridview.
Step 4
Do the following code for assigning the data from the datagridview to the textbox.
- TextBox1.Text = DataGridView1.CurrentRow.Cells(0).Value
- TextBox2.Text = DataGridView1.CurrentRow.Cells(1).Value
Step 5
Double click the “Amount Paid” textbox and do the following code for paying the amount price.
- 'Change = Amount Paid - Price
- TextBox4.Text = Val(TextBox3.Text) - Val(TextBox2.Text)
Step 6
Create another form for the receipt.
Step 7
Go back to the form1 and double click the Print button to fire the click event handler
of it. Then, do the following code for printing the receipt.
- Form2.Label2.Text = TextBox1.Text
- Form2.Label3.Text = TextBox2.Text
- Form2.Label5.Text = TextBox3.Text
- Form2.Label7.Text = TextBox4.Text
- Form2.Show()
Step 8
Do the following code for the "Clear" button.
- Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
- TextBox1.Clear()
- TextBox2.Clear()
- TextBox3.Clear()
- TextBox4.Clear()
- End Sub
For any questions about this article. You can contact me @
Email – [email protected]
Mobile No. – 09305235027 – TNT
FB Account – https://www.facebook.com/onnaj.soicalap
Comments
.VB Codes to print till slips with equal margin on both sides.
Add new comment
- Add new comment
- 7811 views