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.

Creating Application

Step 1

Open Microsoft Visual Studio 2015 and create a new windows form application. ps1

Step 2

Do the form just like shown below. ps2

Step 3

Double click the “Calculate” button and do the following code to calculate the tank capacity when the button is clicked.
  1. Private Sub btnCalculate_Click(sender As Object, e As EventArgs) Handles btnCalculate.Click
  2. Dim height As Double
  3. Dim width As Double
  4. Dim depth As Double
  5. Dim capacity As Double
  6. height = txt_height.Text
  7. width = txt_width.Text
  8. depth = txt_depth.Text
  9. capacity = (height * width * depth) / 100
  10. ListBox1.Items.Clear()
  11. ListBox1.Items.Add("The capacity of the water tank is " & capacity & " Liters")
  12. End Sub
Output ps3 For any questions about this article. You can contact me @ Email – [email protected] Mobile No. – 09305235027 – TNT Or feel free to comment below.

Add new comment