Monday, April 4, 2011

calculate the volume of the tube with visual basic

| Monday, April 4, 2011 | 2 comments

Set His estate:
Object
Property
Nilai
Form
Name
Form1
Caption
Program penghitung volume tabung
Label1
Name
lbljari
Caption
JARI-JARI LINGKARAN
Label2
Name
lbltinggi
Caption
TINGGI TABUNG
Label3
Name
lblluas
Caption
LUAS ALAS=phi*jari-jari*jari-jari
Label4
Name
Lblvolume
Caption
VOLUME=luas alas*tinggi
Label5
Name
Lbljudul
Caption
PRGRAM PENGHITUNG VOLUME TABUNG
Text1
Name
Txtjari
Text
Kosongkan/delete
Text2
Name
Txttinggi
Text
Kosongkan/delete
Text3
Name
Txtuas
Text
Kosongkan/delete
Text4
Name
Txtvolume
Text
Kosongkan/delete
Command1
Name
cmdproses
Caption
PROSES
Command2
Name
cmdreset
Caption
RESET
Command2
Name
cmdkeluar
Caption
KELUAR



1. Variable and Constant Declaration, put on the General
Dim r As Double
Dim t As Double
Dim volume As Double
Dim area As Double
Const pi As Double = 3:14

2. Object Cmdkeluar, OnClick event
Private Sub cmdkeluar_Click ()
Unload Me
End Sub

3. Object Cmdproses, OnClick event
Private Sub cmdproses_Click ()
r = txtjari.Text
t = txttinggi.Text
area = pi * r * r
txtluas.Text = broad
volume = area * t
txtvolume.Text = volume
End Sub

4. Object Cmdreset, OnClick event
Private Sub cmdreset_Click ()
txtjari.Text = ""
txttinggi.Text = ""
txtluas.Text = ""
txtvolume.Text = ""
End Sub

5. Object txttinggi, Change event
Private Sub txttinggi_Change ()
If (txtjari.Text = "") And (txttinggi.Text = "") Then
cmdproses.Enabled = False
Else
cmdproses.Enabled = True
End If
End Sub

if you want to download source code
download volume volume of the tube

2 comments:

Unknown said...

it's gret. i wanna try.

nino said...

;) i like the comments

:)) ;)) ;;) :D ;) :p :(( :) :( :X =(( :-o :-/ :-* :| 8-} :)] ~x( :-t b-( :-L x( =))

Post a Comment

thank you for visiting my blog and comment here. I hope the commentary contains a comment which intend to build and repair. criticism and suggestions I gladly accept.

Popular Posts

 

Total Pageviews

stat

© Copyright 2010. http://programminghaha.blogspot.com . All rights reserved | http://programminghaha.blogspot.com is proudly powered by Blogger.com | Template by o-om.com - zoomtemplate.com