Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

.NET 

[TUT] VB.NET TUT -- Beginners Tut on Adding Two Numbers [TUT]

ok so here we go this my first attempt at a tut on coding dont be a dick.

open up your Microsoft Visual Studios - either Professional or Express (you can get express from MSDN for free)
I am using professional - so here it is guys

included is the source with commets for help just pm me and i will or post in this thread.

Step 1: Start a new Project chose VB.Net for your language if the pc has not already done so...

Step 2: Rename the project file : we will call our project Add2Numbers.vb note: (".vb" stands for visual basic file)

Step 3: On the rigth double click on form1.vb that will open the form.

Step 4: open the tool bar and drag one label, two buttons and two text boxes onto the form place them where you like.

Step 5: name of the the items with real names I like to use names like : firstNumberTextBox and secondNumberTextBox. note: notice the first letter of my names are lowercase this is called camel case this is part of convention in codeing you will also see the FirstLetterTextBox this is called Pascal Case for the way it look at who created the name way back when but that is something if you want to know you can use google for.

Step 6: Hit F7 this will take you to the code behind, only do this once you have name the items look at my souce for the item names but you can also guess that its the numbers textboxs and the button.

Step 7: Now create two varibales to hold a number i recomend decimals to prevent user error.
look at the source included for these but here is an example
Dim FirstNumber as Decimal = 0 always initiliaze a varible be it string or numeric "YOU CANNOT TRUST A PC TO DO YOUR JOB.

Step 8: Now that you have the variables names and the Gui items named your going to need to take textdata a "string" and PARSE THE DATA ( this means to convert) there are examples on MSDN and in my source.

outputLabel.Text = (Decimal.Parse(firstNumberTextBox.Text) + _
Decimal.Parse(secondNumberTextBox.Text)).ToString ' the underscore contiues lines of code
above is an example of the data being parsed from one text box and another and also doing the adding.

Step 9: now that the data calculated the data must be output this is where the label we created comes into play.
the final step is to output
here is an example : outputLabel.text = variableNamedForFinalCalcOfTwoNumbers

OK THIS WAS DONE FROM MY HEAD WITHOUT LOOKING AT THE SOUCE LIKE IF IT WERE A TEST FROM SCHOOL LOL!
Sorry about the caps please tell me if I missed anything and I'll fix it but im sure i didnt im adding the souce file now enjoy guys

http://www.mediafire.com/?h2eswc4b8pvgmi5 PLEASE LET ME KNOW IF THAT DONT WORK
Here is the code:
Dim num1 as decimal = 1
Dim num2 as decimal = 1
Messagebox.show(num1 + num2)

This is pretty basic lol
Wow! You're probably going to be able to easily outcod litespeed
still lurkin. still bitcoin cashin.
I heard suicide was a valiant decision for .net coders.
The thread is very unorganized and you really could've described so much more. -_-" Addition, Subtraction, Multiplication and "algorithms".
(Jul 24, 2012 07:32 PM)Dally180 Wrote:  Here is the code:
Dim num1 as decimal = 1
Dim num2 as decimal = 1
Messagebox.show(num1 + num2)

This is pretty basic lol

your right that is another way of showing the output thanks for the input. these guys could use that. you can also write the data to a file if you wanted but thats is for another thread

(Jul 24, 2012 07:43 PM)Occulta Wrote:  The thread is very unorganized and you really could've described so much more. -_-" Addition, Subtraction, Multiplication and "algorithms".

what algorithms its a simple code for a starter not advanced

(Jul 24, 2012 07:43 PM)Occulta Wrote:  The thread is very unorganized and you really could've described so much more. -_-" Addition, Subtraction, Multiplication and "algorithms".

what algorithms its a simple code for a starter not advanced
(Jul 24, 2012 07:45 PM)Psychotiic Wrote:  your right that is another way of showing the output thanks for the input. these guys could use that. you can also write the data to a file if you wanted but thats is for another thread


what algorithms its a simple code for a starter not advanced


what algorithms its a simple code for a starter not advanced

Now that I think about it I should've said equations, silly me saying algorithms.

Code
Dim Sum As Integer = 1 + 1 * (10 - 5) + (8 / 4) - 1
(Jul 24, 2012 07:54 PM)Occulta Wrote:  Now that I think about it I should've said equations, silly me saying algorithms.

Code
Dim Sum As Integer = 1 + 1 * (10 - 5) + (8 / 4) - 1

Your right but that source only had adding I have others for that but those are for another lesson which I will begin providing often
It's not a very friendly tutorial given you don't have any formatting or reference images..
[Image: Xtddh8V.png]
(Jul 24, 2012 08:14 PM)Fake. Wrote:  It's not a very friendly tutorial given you don't have any formatting or reference images..
Thanks for the input I'll add them but my source should have comments they normally do
(Jul 24, 2012 09:17 PM)_Stoner Wrote:  Isn't this the kind of thread that spreads '.NET Disease' ?

Quite, he said he could "outcod" me anyday and i said go for it.
Sadly this is what he came up with 😵
(Jul 24, 2012 09:21 PM)LiteSpeed Wrote:  Quite, he said he could "outcod" me anyday and i said go for it.
Sadly this is what he came up with 😵

"outcod" are we talking about fish ur retarded, no one cares about what u have to say go to some other forum and waste your life your hated here!
Excellent tutorial. Well written and structured. Will save to my HDD and read to my future grandchildren.

http://www.chillibreeze.com/tutorials/Tu...torial.asp
(Jul 25, 2012 09:17 AM)facebookdoom Wrote:  Excellent tutorial. Well written and structured. Will save to my HDD and read to my future grandchildren.

http://www.chillibreeze.com/tutorials/Tu...torial.asp

glad your happy, others are too but they read it and then talk shit like little kiddies
Thanks for the tutorial man i appreciate your time for it :)


Possibly Related Threads...
Thread / Author Replies Views Last Post
[C] by murtNov 16, 2020 11:43 AM 0 140 Nov 16, 2020 11:43 AM
Last Post: murt
[Java] by cryptobassboostFeb 7, 2019 05:28 PM 4 216 Feb 7, 2019 05:28 PM
Last Post: Caliban
[.NET] by EffexionApr 26, 2018 05:44 AM 0 121 Apr 26, 2018 05:44 AM
Last Post: Effexion