How to Calculate Water Tank Capacity Using VB.Net

Submitted by: 
Visitors have accessed this post 300 times.

In this tutorial I will teach you how to calculate the capacity of a water tank using 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.

Step 2

Do the form just like shown below.

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


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

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • You may insert videos with [video:URL]
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd> <table> <tr> <td> <th> <img> <h1> <h2> <h3> <iframe> [video]
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>, <asp>, <c>, <cpp>, <csharp>, <css>, <html4strict>, <java>, <javascript>, <mysql>, <php>, <python>, <sql>, <vb>, <vbnet>. The supported tag styles are: <foo>, [foo].
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.