Making Round Application

This application is an example for accounting in a program. It means that this is our 1st program  that is able to do program as a basic to make more complicated program. In this program you have to prepare :

-Label

Properties :

Text :Radius :

-Label

Properties :

Text :Surface :

-Label

Properties :

Text :Circumference :

-Textbox

Properties :

Name :txtradius:

-Textbox

Properties :

Name :txtsurface

-Textbox

Properties :

Name :txtcircum

-Button

Properties :

Name :btcount

Text :Count

-Button

Properties :

Name :btreset

Text :Reset

Here is the appearance :

Then,  Click twice into btcount , and type source code below :


Public Class Form1

Dim r, surface, circum As Double

Const phi = 3.14

Private Sub btcount_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btcount.Click

r = Val(CDbl(txtradius.Text))

surface = phi * r ^ 2

circum = 2 * phi * r

txtsurface.Text = surface

txtcircum.Text = circum

End Sub

Also type Click twice into btreset, and tpe source code below :


Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btreset.Click

txtradius.Text = ""

txtsurface.Text = ""

txtcircum.Text = ""

txtradius.Focus()

End Sub

Now, you’ll need to run your program (press F5)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: