Today i will teach you how to make a calculator in VB.NET , making your own calculator would be awesome.
13 . then copy and paste this bunch of code
14. enjoy
I did a tutorial about making an advanced calculator, you would love it : How To Make A Advance Calculator In VB.NET
- open visual basic 2008 or visual basic 2010
- create a new project
- windows form/console application
- change your form size to 223, 274
- go to form1 properties and text name it whatever you want (calculator)
- add 18 buttons from the tool box
- add a textbox
- click textbox then properties and multiline and make it true
- click text box and properties and click font and make the font little bigger
- make the text box little bigger
- now change the button text to look like this
13 . then copy and paste this bunch of code
13 . now debugOption
Explicit
On
Public
Class
Form1
'Author : Mohamed Shimran
Dim
FirstNumber
As
Single
Dim
SecondNumber
As
Single
Dim
AnswerNumber
As
Single
Dim
ArithmeticProcess
As
String
Private
Sub
Button1_Click(
ByVal
sender
As
System.
Object
,
ByVal
e
As
System.EventArgs)
Handles
Button1.Click
TextBox1.Text = TextBox1.Text & 1
End
Sub
Private
Sub
Button2_Click(
ByVal
sender
As
System.
Object
,
ByVal
e
As
System.EventArgs)
Handles
Button2.Click
TextBox1.Text = TextBox1.Text & 2
End
Sub
Private
Sub
Button3_Click(
ByVal
sender
As
System.
Object
,
ByVal
e
As
System.EventArgs)
Handles
Button3.Click
TextBox1.Text = TextBox1.Text & 3
End
Sub
Private
Sub
Button4_Click(
ByVal
sender
As
System.
Object
,
ByVal
e
As
System.EventArgs)
Handles
Button4.Click
TextBox1.Text = TextBox1.Text & 4
End
Sub
Private
Sub
Button5_Click(
ByVal
sender
As
System.
Object
,
ByVal
e
As
System.EventArgs)
Handles
Button5.Click
TextBox1.Text = TextBox1.Text & 5
End
Sub
Private
Sub
Button6_Click(
ByVal
sender
As
System.
Object
,
ByVal
e
As
System.EventArgs)
Handles
Button6.Click
TextBox1.Text = TextBox1.Text & 6
End
Sub
Private
Sub
Button7_Click(
ByVal
sender
As
System.
Object
,
ByVal
e
As
System.EventArgs)
Handles
Button7.Click
TextBox1.Text = TextBox1.Text & 7
End
Sub
Private
Sub
Button8_Click(
ByVal
sender
As
System.
Object
,
ByVal
e
As
System.EventArgs)
Handles
Button8.Click
TextBox1.Text = TextBox1.Text & 8
End
Sub
Private
Sub
Button9_Click(
ByVal
sender
As
System.
Object
,
ByVal
e
As
System.EventArgs)
Handles
Button9.Click
TextBox1.Text = TextBox1.Text & 9
End
Sub
Private
Sub
Button10_Click(
ByVal
sender
As
System.
Object
,
ByVal
e
As
System.EventArgs)
Handles
Button10.Click
TextBox1.Text = TextBox1.Text & 0
End
Sub
Private
Sub
Button11_Click(
ByVal
sender
As
System.
Object
,
ByVal
e
As
System.EventArgs)
Handles
Button11.Click
TextBox1.Text = TextBox1.Text &
"."
End
Sub
Private
Sub
Button13_Click(
ByVal
sender
As
System.
Object
,
ByVal
e
As
System.EventArgs)
Handles
Button13.Click
FirstNumber = Val(TextBox1.Text)
TextBox1.Text =
"0"
ArithmeticProcess =
"+"
End
Sub
Private
Sub
Button14_Click(
ByVal
sender
As
System.
Object
,
ByVal
e
As
System.EventArgs)
Handles
Button14.Click
FirstNumber = Val(TextBox1.Text)
TextBox1.Text =
"0"
ArithmeticProcess =
"-"
End
Sub
Private
Sub
Button15_Click(
ByVal
sender
As
System.
Object
,
ByVal
e
As
System.EventArgs)
Handles
Button15.Click
FirstNumber = Val(TextBox1.Text)
TextBox1.Text =
"0"
ArithmeticProcess =
"X"
End
Sub
Private
Sub
Button16_Click(
ByVal
sender
As
System.
Object
,
ByVal
e
As
System.EventArgs)
Handles
Button16.Click
FirstNumber = Val(TextBox1.Text)
TextBox1.Text =
"0"
ArithmeticProcess =
"/"
End
Sub
Private
Sub
Button18_Click(
ByVal
sender
As
System.
Object
,
ByVal
e
As
System.EventArgs)
Handles
Button18.Click
SecondNumber = Val(TextBox1.Text)
If
ArithmeticProcess =
"+"
Then
AnswerNumber = FirstNumber + SecondNumber
End
If
If
ArithmeticProcess =
"-"
Then
AnswerNumber = FirstNumber - SecondNumber
End
If
If
ArithmeticProcess =
"X"
Then
AnswerNumber = FirstNumber * SecondNumber
End
If
If
ArithmeticProcess =
"/"
Then
AnswerNumber = FirstNumber / SecondNumber
End
If
TextBox1.Text = AnswerNumber
End
Sub
End
Class
14. enjoy
I did a tutorial about making an advanced calculator, you would love it : How To Make A Advance Calculator In VB.NET
44 comments
Not working, it says that (Error 1 Handles clause requires a WithEvents variable defined in the containing type or one of its base types. C:\Users\Owner\Documents\Visual Studio 2010\Projects\Calculator\Calculator\Form1.vb 79 100 Calculator
Reply) What do I do? Please Help? :(
i think that is a simple error , if you just create a new project and try this again then this will work you can also try this advanced calculator
ReplyNice tutorial
ReplyGREATE WORK I LOVE VB AND YOU INSPIRE ME TO DEVELOPS VB PROJECTS VISIT MY SITE AND GET MORE STUFFS CLICK HERE http://premtrivedi.blogspot.in/
ReplyDoesn't work for me i don't know why
ReplyWhat kind of errors you get? by the way if you don't mind theres another calculator little bit advanced, check Here
ReplyThanks :)
Replyhey i keep getting identified expected ? any chance i can fix that?
Replysorry figured that out its the last part saying my first number is not declaired then arithmamatic not decalired
Replyim sorry im computer illitarit
Great tutorial, i've been looking around on how to start programming. Thank you
Replyhow is there 18 buttons i counted 16 im really confused and i'm new to VB
ReplyThere are 16 buttons :)
Replyevery time i do 2 + 2 or something it just says 0 i dont know why
Replyi am getting 1+2+3=5 instead of 6 pls pls pls help....its urgent
ReplyIt's a pretty old tutorial, Maybe you could checkout the new one : http://ultimateprogrammingtutorials.blogspot.com/2013/02/how-to-make-advance-calculator-in-vbnet.html
ReplyGreat work.. <3
ReplyHello friends.........I have also searched for good tutorial on making calculator.
ReplyBest working solution i have found here :-
http://geeksprogrammings.blogspot.com/2013/09/make-calculator-in-net.html
free Download Project is also availiable with good explantion
I nlike the appropriate answer......
ReplyThis Is So Boring i Preffer making a porn site
ReplyLOL
All of the answer is 0 like
Reply1+1 = 0
2+4 = 0
Please help me !!!
Very Nice Tutorial I like it
Replyit dose not work noob
ReplyYeah not working everything and the codes number has been skipped 11 then 13 then 18 do you know how to count
Replyman it doesnt work.
ReplyYou need to create those items before you enter the code =P
ReplyYou need to create those items before you enter the code =P
ReplyVBasic Code Examples
ReplyThank you for the source code .it assisted me alot. Kudos
ReplyEchaba de menos un replicas relojes grande y voluminoso de Breitling para Bentley, del tipo que te apetece llevar una roca en la muñeca. Recientemente me dieron un Breitling Bentley Supersports réplica reloj y tengo la revisión para mostrar a you.One de Breitling para Bentley no es tan popular modelo es el Supersports. Voy a tomar una conjetura salvaje aquà y "culpar" a los colores. De alguna manera siento que la mayorÃa de los hombres no están en los replicas rolex con colores llamativos. Por supuesto que esto se traducirá en el mismo tipo de preferencias en el mundo de relojes Bretiling réplica. Asà que estamos mirando bastante a un modelo de Bretiling falso con una popularidad y un interés medios.
ReplyComprar Breitling réplica de relojes en lÃnea le
replicas breitling ofrece una buena experiencia. Esta vez fui para una réplica de reloj Bentley Supersports. Me gusta el dial diferente con esos tres cronógrafos que son la marca registrada para este modelo de Bentley. Este sub-modelo en particular no está entre los sub-modelos más populares entre los
replicas omega, pero las diferentes miradas podrÃan funcionar bien.
Ossas
Replyso very simple Easy ka..
ReplyIn particolare, Baselworld ha fornito a Vector l’opportunità per replica orologi presentare i suoi due modelli di smartwatch – il Luna e il Meridien. Se siete appassionati del genere, sarete Tag Heuer replica felici di sapere che arriveranno sul mercato a settembre di quest’anno.
ReplyVery helpful tutorial. Thank you.
Replyawesome post.Thanks for sharing.
ReplyVuescan Crack
so very simple Easy ka.
ReplyHD Video Converter Factory Pro Serial Key
Dreamweaver Crack Nice tutorial. Thank you.
ReplyIn this era SAP Training is most useful web language for web development program. A variety of businesses that make use of SAP Training web language solutions or connected services are able to combine their systems in a superior & quicker way & also offer information almost anytime & anyplace on any given device.
ReplySAP Training Institute in Noida
sap training in noida
sap institute in noida
sap course in noida
best sap training institute in noida
Very nice and helpful post. Waiting for your next article. Thank you.
ReplyVery nice and helpful post. Waiting for your next article. Thank you.
Replythank you, I read and always read the article on this website
ReplyThanks for sharing the information.Impressive and i would like to share this with my friends
ReplyIndian Cyber Army’s most awaited internship is live now. Summer Internship 2018 on “ Ethical hacking” and book your seats before it runs out.Candidates have to get themselves registered to be a part of this Internship program. Here internship will give you on-the-job experience, help you learn whether you and Cyber security industry are a good match and can provide you with valuable connections and references. Here interns are usually exposed to a wide variety of tasks and responsibilities which allows the intern to showcase their strengths by working on projects for various managers that work on different parts of Indian Cyber Army. Becoming a high performing intern is a fantastic way to improve your employment prospects. This internship can be a great way to get your foot in the door of success with a prestigious or desirable Organization.As career in ethical hacking is most in demand.
Get to know about career in Ethical Hacking. Career Overview, Salary, Key skills and Education needed. Get how to Become Ethical Hacker guidelines ...
ReplyIn this age of Technology advancement, computer and information technology have not only brought convenience to citizens in modern life but also for policemen & various Government officials of the nation to fight cybercrime through various modus operandi. Indian Cyber Army has been dedicated in fighting cyber crime, striving to maintain law and order in cyberspace so as to ensure that everyone remains digitally safe.Read more:- Information Security
ReplySuch an awesome blog.
Replyweb designing in coimbatore |
web design in coimbatore
Post a Comment
Note: Only a member of this blog may post a comment.