borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (text)Next Topic (sound) New Topic New Poll Post Reply
AndreaVB Forum : VB General : NEW STUDENT NEEDS HELP
Poster Message
greenough157
Level: Guest


icon NEW STUDENT NEEDS HELP  Archived to Disk

I am brand new in VB and I need help with my programs. I need to write a program that will give me the circumference of a circle with a given radius. Can anyone help?

12-06-2002 at 11:41 AM
| Quote Reply
dcostelloe
Level: VB Guru

Registered: 11-06-2002
Posts: 74
icon Re: NEW STUDENT NEEDS HELP  Archived to Disk

Try this:
http://www.maxcode.com/nuke/article.php?sid=305

Google works well to  

____________________________
Life is but a merry go round
around and around :-)

Visit us today:
http://www.welford-costelloe.com

12-06-2002 at 08:56 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
vivek
Level: Guest

icon Re: NEW STUDENT NEEDS HELP  Archived to Disk

quote:
greenough157 wrote:
I am brand new in VB and I need help with my programs. I need to write a program that will give me the circumference of a circle with a given radius. Can anyone help? ???


Try this. It is very simple. After knowing te concept you can improve your form by changing the controls, codes etc. Good luck.


'Add two text boxes and name them as txtRadius and txtCircum to receive input and display output respectively.
'Add three command buttons and name them cmdCalculate, cmdClear, cmdExit
Option Explicit
'Variable types are variant by default. Type can be specified as Int, Single etc.
Dim Radius 'Declare variable Name for radius
Dim Circum  'Declare variable Name for Circumference

Private Sub cmdClear_Click()
txtRadius.Text = "" 'This is to clear the Radius text box when you click the Clear button
txtCircum.Text = "" 'This is to clear the Circumference text box when you click the Clear button
End Sub

Private Sub cmdExit_Click()
End ' This is to exit the program when Exit button is clicked
End Sub

Private Sub cmdFind_Click()
Const PI = 22 / 7 ' Constant is defined
Radius = txtRadius.Text 'Variable is assigned to text box to receive input from the user
Circum = PI * 2 * Radius 'Variable is defined (formulae for circumference)
txtCircum.Text = Circum ' Variable assigned to text box to disply output
End Sub
14-06-2002 at 03:09 AM
| Quote Reply
AndreaVB Forum : VB General : NEW STUDENT NEEDS HELP
Previous Topic (text)Next Topic (sound) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder