How to Create Calculator in Visual Basic.Net Full Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi I'm welcome to this a brief tutorial a calculator I know enough created their various calculators before but this one I just want to show you guys one or two teens that you can also do when developing calculator so the more question and really do now is just to maybe put my buttons first so right there I have my bottom in place this very button I'm just going to change a properties so I know where bother change the names you can always do that if you want so just change this font property now I set out to bold and maybe the size just make that 28 so that's fine so the text change the text itself to 1 so that is set for this very button so all I just need to do is to hold down my compare my control and just drag it across to 3 and number 4 now select hold down the control drug repeat the same thing drug and just one more for equals I hold it down and that's your equals so the next thing I will do is just to change the text content so does 2 3 and r45 six seven eight number nine zero as my decimal points without Eclair equals plus minus multiplication division dead so the next part is just to get my text box in place I'll be my display writer as it as drug is up to us with their now set the align into a line right there are and plus zero as the text contention the font size as well to 28 let's change that 28 as well unjust will be dead that's about right so let me double click on our double click on the form and declare four variables okay the next thing is just to declare some variables so I'll declare first number may God decima Oz decima and second number as decima as well I'll change that a second there two more decimal here this one called operations operations as integer then let me declare one cooling or less code is operator operator operator and discourse select select oh all right seems to be long but that's okay ah spooling in this case marbling let me set that force there okay I now have all my four variables in place so the next thing I'll do is set start right away double click on bottom one and enter the following lines of code so the very first line of course up it's a tense pops one gets will swindle tanks then textbox 1 dot X plus equals 1 else else text box one just copy that text box one eat was one so that's the very first line of code for the there first button button 1 you can see his air text box 1 it's not equal to 0 then you I'd want to eat else equals 1 so my destroy just copy and paste that in bottom two so how many I don't think important to repeat exactly the same thing Delhi Chennai chain is now this number one chain number one to repeat exactly the same tune for more than three there so it's just exactly the same thing I'm doing right now repeat the same process for voting for paste so I'm now going to speed it up and I'll get back to you guys okay number 1 2 9 event all the codes in number one tonight and see just similar clothes apart from 0 but before that let me just try it out I'm talking about so when I take them one two four six eight okay zero is not working yet these are not working so let's get this coded now we don't click on zero in the case of 0 we just changes to 0 and get rid of the else whatever just a we look at yeah and that's the zero right there done okay now let's take care of the clear button so we just save text box text box 1 dot text your time that's it zero okay so the text box that's what he forced up or for the decimal place was a right there so if not text box one don't text that contains dot then text box 1 dot X plus equals done okay the next thing is the programming of the plus button and there okay first number I stored inside a variable I sorry the text value is stored inside case number and the text box actually default to 0 in that case operator selector becomes true and the operator become one which is for the plus sign and look up here right up here you can see the operator selector was false now it becomes true and operator there becomes the operator there becomes one and they can even put a comment just say equals loss so I just need to do is say copy that and repeat exactly the same thing for the plus sign case that there is becomes two - would be the same thing for the addition so anytime you select that the system we actually see the operator see the operator us the plus -3 aside in modification of minus 3 plus minus sign answer 2 + 1 as the plus sign why the division sign would be food and piss that writing they change out to 4 and thus commented that is it so the last but not the least would be d equals sign and right here are the codes for the equal sign right there I suppose you can see it so each select I equals true then the value inside the textbox is stored inside variable second number and if operator equals 1 then we add these together first number plus second number straight in there else - for brittle goes to now BD subtraction sign operator equals 3 the same thing else if circle number equals 0 in the system we display arrow else to division son to take precedent and and if and if operator select or equals force and that is all there is to it so now let's try out our system okay not just let's just try out this calculator Lacey 23 plus 6 there we play the gear button works supposing we say 5 divided by 0 hmm you should know what that means an arrow because that's impossible Claire 8 times 5 40 minus 4 divided by 82 or let's say 21 not number and yeah that's what you get okay so guys that's how you develop a calculator I'm just gonna call it a day for now so you all have a nice day and just before I leave let me show you the lines of codes again right from the top it's a very simple code and walks more effectively you have a nice day now and bye for now
Info
Channel: DJ Oamen
Views: 767,262
Rating: undefined out of 5
Keywords: Tutorial (Media Genre), Visual Basic (Programming Language), How to Create Calculator Visual Basic Full Tutorial, Calculator Visual Basic Full Tutorial, Create Calculator Visual Basic Full Tutorial, Calculator, Visual Basic .NET (Programming Language)
Id: RhCzj5q6uqA
Channel Id: undefined
Length: 12min 30sec (750 seconds)
Published: Wed Nov 12 2014
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.