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.

minic12

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.

  1.         DataGridView1.Rows.Add("Chicken Wings", "100")
  2.         DataGridView1.Rows.Add("Beff Tapa", "200")
  3.         DataGridView1.Rows.Add("Chicken Adobo", "150")
  4.         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.

mnic21

Step 4

Do the following code for assigning the data from the datagridview to the textbox.

  1.         TextBox1.Text = DataGridView1.CurrentRow.Cells(0).Value
  2.         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.

  1.         'Change = Amount Paid - Price
  2.         TextBox4.Text = Val(TextBox3.Text) - Val(TextBox2.Text)

Step 6

Create another form for the receipt.

minic123

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.

  1.         Form2.Label2.Text = TextBox1.Text
  2.         Form2.Label3.Text = TextBox2.Text
  3.         Form2.Label5.Text = TextBox3.Text
  4.         Form2.Label7.Text = TextBox4.Text
  5.         Form2.Show()

Step 8

Do the following code for the "Clear" button.

  1.     Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
  2.         TextBox1.Clear()
  3.         TextBox2.Clear()
  4.         TextBox3.Clear()
  5.         TextBox4.Clear()
  6.     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

Very good tutorial for beginners. Just add a line to save the code by pressing save button on toolbar before starting.

Hi, how do you do, Kindly help me with the .net codes to print a receipt on a slip printer that prints 76mm wide till slips. Auto cut off. The slip printer has the following details. Company Address in 5 lines column heading "Item Description @UnitPrice Qty Amount" total number of items, and total amount At present, the margins on both sides are not equal. I hope you will be able to help me. Thanks and regards. Let me know your fee as well.

Add new comment