How to Calculate Water Tank Capacity Using VB.Net
In this tutorial I will teach you how to calculate the capacity of a water tank using vb.net. You maybe have water tanks at home or in any infrastructure; it is a large chamber used for storing water and it comes in variety styles. And you might need to calculate the water tank to make sure that your water source provides enough water. Take a look at the procedure below to find out how.
Open Microsoft Visual Studio 2015 and create a new windows form application.
Do the form just like shown below.
Double click the “Calculate” button and do the following code to calculate the tank capacity when the button is clicked.
- Private Sub btnCalculate_Click(sender As Object, e As EventArgs) Handles btnCalculate.Click
- Dim height As Double
- Dim width As Double
- Dim depth As Double
- Dim capacity As Double
- height = txt_height.Text
- width = txt_width.Text
- depth = txt_depth.Text
- capacity = (height * width * depth) / 100
- ListBox1.Items.Add("The capacity of the water tank is " & capacity & " Liters")
- End Sub
For any questions about this article. You can contact me @
Email – [email protected]
Mobile No. – 09305235027 – TNT
Or feel free to comment below.