Added: 2 years ago
From: QuackWare
Views: 132,814
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:
see all

All Comments (113)

Sign In or Sign Up now to post a comment!
  • when i'm done this in a couple minutes my co-workers will be impressed

  • thank you for this video. this was very helpful :))

  • Hey, the error message I get is System.Web.UI.WebControls.Text­Box' does not contain a definition for 'Tag

    I have followed your code to the letter. Any suggestions?

  • Question: When I'm at plus = true , I get error that plus is already in use. I searched, and the only other plus is the bool plus = false; . Any suggestions?

  • Guys I hope you know that anything you do in VisualANYTHING is NOT programming. If you want to do programming you have to learn the idea of everything you use (and by everything I mean EVERYTHING). This is as hard as drawing a picture with paint. This is not what programmers learn in university. Just for you to know...

  • Comment removed

  • Comment removed

  • instead of: textBox1.Text = textBox1.Text + "1";

    You can use 1 event click to all the numbers (1-9)

    try the code below:

    textBox1.Text += (sender as Button).Text;

  • any tips on remembering all the code???

  • how could you make it so that numbers could be entered from the keyboard rather than by having to click them on the form?

  • You made it way to complicated, you don't need all of the ' { ' and ' } 's

  • What about a delete button

  • Is it possible to set more than one button as AcceptButton?

  • /watch?v=sOuak_F9DbY

    /watch?v=sOuak_F9DbY

    /watch?v=sOuak_F9DbY

    /watch?v=sOuak_F9DbY

    /watch?v=sOuak_F9DbY

    /watch?v=sOuak_F9DbY

    /watch?v=sOuak_F9DbY

    /watch?v=sOuak_F9DbY

    /watch?v=sOuak_F9DbY

  • Hi, great tutorial. I have found a bug in my calc, unsure whether you will have the same. Been through the videos twice now to check the code, same as yours as far as I can see.

    If I do a calculation then immediately do another 1 without clearing the field I get negative numbers, prior to the checkifequal I think it was working ok. Any chance of you just running through my code?

    Thanks

  • Excuse me, but I tried to type like you said on the buttons of 1,2,3,4,5,6,7,8, & 9 by " textBox1.Text " but the problem is it doesn't work with me at all, which the error message says: " The name 'textBox1' does not exist in the current context. So, is there anything else I put in there instead of that?

  • @Bedaywee Check the proporties of the text box you have on the form1. see if its name is textBox1 or try to rename it.

  • easy way for all number buttons

    buttonOnClick(object sender, EventArgs e)

    {

    text1.Text += this.Text;

    }

    add this event for all buttons

  • instead of doing the if statement for checking for a "." to return if found, do this:

    if (! textbox.text.Contains("."))

    { textbox.text += ".";

    }

    this way it'll add the . only if there isn't one in there, otherwise it does nothing

  • i have a project for tomorrow, to submit a simple calculator, ive done the coding but i dont know how to make it loop like after ive done it will ask if i like to continue . . . mine just exit! plus i need flow chart for my coding . .. . .. . help :(

  • just a little tip , when you need to add something to a (i'm not sure how it called , like int or textBox1.text in this example ) instead of writing it twice (textbox = textbox +)

    just write += it is the same and it sortens your work [ textbox.text += ("1") ; ]

  • 0:01

  • finally a NON console tutorial

  • I'm sick of commercials

  • you could easily say tbxText.AppendText(string)

    

  • Can you please tell me the code for backspace button?

  • Thanks a lot man! it helps me greatly.

  • dude - you sound like you'r sleeping xD

  • HOW TO USE THE CONTAINS AND REMOVE ADD FUNCTIONS IN VISUAL C++

  • dude sounds sleepy :)

  • i hate BOOL DX

  • i love your vids!!!! keep on going:)

  • hello and ty for upload, but i just wanna know if this works in 2010 too :) since thats what we are working with in school :)

  • why not textbox1.text += "1";?

  • Comment removed

  • So textbox1 is a char array and its automatically adding each character number to the next element?

  • sings: peak kia car diarrhea!

  • I'm having problems with my equals button. "It says 'Decimal ' is a type and cannot be use as an expression." I tried a few thing (I have no idea what I did) and I got it to come up as true or false but I changed it back. I'm confused about what goes after the 'Decimal' and if I have to 'Dim' "dec" or something. Any ideas on how yo fix it?

  • can someone help me? everytime I enter the code for "1" a debugger pops up and it crashes my program, making me have to restart. How do i fix it?? its bugging the shit out of me!

  • Can you help me? Im having a lot of trouble with the decimal part, it just wont work. I copyed down exactly what you did and still nothing. This is the line of code i start with after duoble clicking the decimal button private void button2_Click(object sender, EventArgs e)  { } }

    } it doesnt say private void buttonDecimal_Click like yours does, could that be the problem?

  • @TryNotTooBLiNK okay it isnt working T_T

  • @TryNotTooBLiNK Nevermind, i started over and did all of your steps exactly how you do em andim done with my calculator! :D THANKS

  • Nice work! Came here, searching on how to make a simple forms calculator using VS... I have two text boxes that I use as my input boxes, and a button that adds them, displaying the result in a 'label' field. as you explained, just adding numbers takes some work!

    private void button1_Click ( object sender, EventArgs e ) { decimal ans = Convert.ToDecimal ( textBox1.Text ) + Convert.ToDecimal ( textBox2.Text ); answer.Text = Convert.ToString ( ans ); }

  • hi, great vid ! thank u ! when i press the decimal button ," System.Windows.Forms.TextBox, Text: ." this text is coming do you kw y ? plz help new to c sharp. thanks in advance.

  • I need HELP! Why is it when i create a plain win32 project i dont get the "form design" tab? All i can edit is the file menus and such, i am unable to add buttons. And if its not possible, whats the difference between form app and win32?

  • could you please give me the source code, because I want to learn how you do it.

    send it to my email address phuastanley2006@yahoo.co.jp

    Thank you in advance

  • ok i am making a program how do i use a button to open another window(project)?

  • @xXbullet002Xx just double click on that button

  • The decimals don't work, when you enter: 0.01 + 0.6 it says 7, instead of 0.61 Help pls?

  • @xixw you read my mind :P

  • good one dude...!

  • You would have saved some time if you had done this.

    void Digit_Clicked(object sender, EventArgs e)

    { Button tempButton = (Button)sender; textBox1.Text += tempButton.Text;

    }

    and then just apply this to every digit button.

  • Nice tutorial. Really helpful.

  • at 3:20 i get an error for the TextBox1.text = textBox1.Text + ".";

    the error says: "The name 'TextBox1' does not exist in the current context." the first part, before the equal sign is where this occurs.... could you help me? =]

  • when ive made my calculator, ive written code for the "1" button, but when i debug my calculator is blank

  • Is this scripting language similar to LUA?

    I know pretty much lua and it would be great if C sharp was not to different :/

  • How would you set the textbox1 to display "0" such as in a Windows calculator? Then once a number button is clicked, the value of "0" would be replaced by whatever a user pressed?

  • check it dude.

    for example.

    0.1 + 0.9

    doesn't work :)

  • to make it a lot nicer you can change textBox1's TextAlign to Right and change the Form's border style to fixed 3D

  • Comment removed

  • hello QuackWare u've written a really tutorial but i dont ther's some problem occured with streming of video

    ther's always an error occured

    please send me its code plz.

  • Hello, this tutorial is really helpful, but I am using the vb2008 express edition and i can't do the + button, the bool feature doesnt exists. Any help please?

  • @ivoivo001

    Never really used vb.net but I do know for a fact that there is a bool data type in visual basic.

    Something like this:

    Dim isCool As Boolean = True

    ' If statement

    If isCool Then MsgBox("Quackware is cool")

    End If

    Would be the simplest of examples.

  • @QuackWare

    Fixed this as well

    in vb2008 express you have to write the following code above ur scrip":

    "dim dec as decimal"

  • hey what if i wanna add a sin ,cos, tan etc. to my calculator

    and also want a textbox to be multiline upper line shows the expression and lower line shows current value that is inputtted.....

  • @navjot1331

    For sin, cos, tan there are built in C# functions, Math.Sin() Math.Cos() Math.Tan()

    For the multilines you would have to mess around with the textbox properties, I don't know how to do this off the top of my head.

  • I am trying to follow your tutorial, and im a noob even at basic coding. But i noticed that your formatting is very different. I am working around it but i am having to type different things to get the same result. Im stuck on bool, it says declaration expected under the error code. Any suggestions :s ? Sorry if that sounds confusing.

  • @Joeyz1994 If you send me your source code or an image of your source code with the error I can try and debug it and see what is wrong.

  • @QuackWare How do you do a clear button? Your video stopped loading and I need to know lol.

  • @Joeyz1994 are you sure you are using c# and not visual basic, c++, or another language?

  • wow so visual studio is for making server programs programs and stuff like that?

  • Great Tutorial!

    Thank you very much :)

  • Dear Quack

    Just seen the first part of your video and I got a doubt.

    If I were to add -1+-1 and -1 - -1

    Will it work.

  • @daboos2008 I did not fully test the code and no longer have it so I am not sure what it does. It probably doesn't work so you should find a way to fix it :)

  • How in the hell... The stuff you were explaining wasn't working, so I changed some of the code to GML and it actually worked. FUCK YEAH GAME MAKER!

  • im used to visual bsic and in visual basic fo the pos negative i just pu

    textbox1.text = val(textbox1.text) * (-1)

    i really enjoyed the val function because it allowed me to make cacluations inside the code is there a funtion like this in c#

  • thanx a lot QuackWare..Much needed one for me..cheers..:D

  • I would write:

    textBox1.SelectedText = "1";

    not:

    textBox1.Text = textBox1.Text + "1";

  • im suscribed

  • hi guys i have a question i also want a Backspace button.

    som1 can tell me the code for backspace?

    thank you for help :)

  • thanks alot

  • Why am i getting " plus is not declared" ???? :( please help me out:)

  • Really excellent stuff, just a few comments and one questions. Comments first.

    - building the form can be complicated, maybe show how to do it.

    - there's no '0'. Programming it is harder then other numbers.

    - Your voice should be louder and you sound like you're medicated.

    Question

    - Why don't the keys in the keypad show the numbers the same way the windows calc does?

    - In the command prompt version of c# you can do +=, (like a = a + b), but you can't here. What up with that?

    thanks!!!!!!!

  • You can use += in visual c#. As for the keys, you need to use the key events to get the pressed keypad number or any other key for that matter.

  • thank you dude

    thats perfect

    please do it more ;)

  • i have visual studio 2010 and dont know where to put bool plues = false. help pelase

  • The program crashes when you divide by 0. How can that be fixed?

  • catch the exception using "try-catch", for example:

    equals_button_click()

    { try { // math operation code.....}

     catch (Exception ex) { textBox1.text = ex.Message; }

    }

    this way it'll just show the error message on the text box without the program crashing.

  • you could type in the divide button

    if (Textbox1.Text == "0")

    (

    Messagebox.show("can not divide by 0");

    )

    else

    divide = true;

    textBox1.Tag = textBox1.Text;

    textBox.Text = "";

  • why my program does not work? I've followed all your instructions.. btw, mine is VS 2005. does it affects the program?

  • The code might not necessarily be the same, especially since I premade most of the GUI elements so they might be named differently.

  • you sould use comments in your code. There'isnt any comments. That is absolutely bad programming.

  • @neutrino216 who are you?

  • Good presentation!

  • I love u! AND U MADE HD!!!!!! Your my god! Please keep uploading vids! I really need ppl like you to help us newbies!!

  • You should probably use cntrl+v and cntrl+c more often :P

  • Thanks a lot!

    I always wanted a calculator tutorial in C#.

  • soo helpful Thanks!!!

  • gr8 job :)

    just 1 comment

    if( ! textbox.text.contents("."))  textbox.text=textbox.text + ".";

    without else :)

    less code, better code

    cya

  • This tutorial is useless. It begins with the interface already done...

  • @IrritatingMaze lolz, so you cant place some buttons on a form???

  • Does anyone know why i dont have the .Tag function used in the Plus button?

    I am using visual web developer 2008

  • with which program u film this????

  • Nice vid.

  • great vid dude !!!! please upload more videos for beginners thnks

  • thanks man...... I was doing some thing with msdn, but they delete all their videos ..... so I must see it on ytb. .... thanks again....

  • Thanks a lot that helped me! I know some c sharp but that cleared some things up, thanks again

    great quality video!

  • It's the intelisense from Visual Studio 2008.

  • how do you get text thing to come up (i mean when you start typing)

Loading...
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more