In this tutorial, I will teach you how to
create a mini booking system in vb.net. This booking system ca
n calculate the total payments of the guest and it can do payments. This is a good start for you when you are starting programing and do some simple projects.
Creating Application
Step 1
Open
Microsoft Visual Studio 2015 and create a new windows form application.
Step 2
Do the form just like shown below.
Step 3
Double Click the Form and do the following codes for adding item in the combobox in the first load of the form.
With ComboBox1.Items
.Add("Standard Room with TV And Electric fan (2 person)")
.Add("Family Room with TV And Electric fan (6 person)")
.Add("Deluxe Room with TV And Aircondition (6 person)")
End With
Step 4
Go back to the design view and double click the “
Calculate” button to fire the
click event handler
of it. Add the following code for calculating the summary of the payments.
Try
Dim totalprice As Double
Dim personPrice As Double = Val(TextBox2.Text) * 100
totalprice = Val(TextBox1.Text) + personPrice
TextBox3.Text = totalprice
Dim change As Double
change = Val(TextBox4.Text) - Val(TextBox3.Text)
TextBox5.Text = change
Catch ex As Exception
MsgBox(ex.Message)
End Try
Step 5
This code is for the amount paid.
Try
Dim change As Double
change = Val(TextBox4.Text) - Val(TextBox3.Text)
TextBox5.Text = change
Catch ex As Exception
MsgBox(ex.Message)
End Try
Step 6
This code is for the clear button
ComboBox1.Text = "Select a Room"
TextBox1.Clear()
TextBox2.Clear()
TextBox3.Clear()
TextBox4.Clear()
TextBox5.Clear()
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
Or feel free to comment below.