Part of the series of tutorials on programming C# for beginners
Continues with the creation of a basic calculator, making all the buttons work and teaching you string manipulation techniques
Source code: https://github.com/angelsix/youtube
Proudly WWW.PONIREVO.COM
it deleted for me from the left to the right … please how to inverse that
1- Man Thanks for the video
2- You explain for us like we know what you are talking about , man we don't try to explain for as from scratch
3- in certain moments we think you have no idea what are you doing , try -eliminate till it works , that's a bit confusing .
Thank You after All
42:06 turn on subtitles
I used this to focus and select from the end at the same time.
#this.UserInputText.Select(this.UserInputText.Text.Length, 0); // Select from a start position N characters forward with N=0 and the start
// position being my text length
Basically its saying UserInput is a method and not valued in the context shown above, 1:41
1:41 When i try to use the string empty method i get this error" Severity Code Description Project File Line Suppression State
Error CS0119 'Form1.TxtUserInput(object, EventArgs)' is a method, which is not valid in the given context Calculator C:UsersjxcwiDesktopProgrammingOOPCalculatorForm1.cs 28 Active
"
These video's have been great help for me. Thank you!
I wish YouTube suggested follow-up video's however, saves me from searching it manually. Perhaps you could include links in the video/description.
Brilliant tutorial. Helping me brush up on my C# before job interviews so it's really come in handy with best practices and keeping clean and commented code
The "C" and "CE" buttons have different functions. The "C" button acts as a Clear All function, essentially deleting all of your input.
The "CE" button acts as a Clear Entry function, only clearing the last number you've inputted.
Moot point but your implementation of CE is incorrect.
Still a great tutorial though!
I've been wondering. I, instead of having a method for each button, made one method for a click event with a switch inside of it. It has a case for C, backspace and operators with default being numbers. Is that ok? Or is it actually better for each button to have it's own method?
Code comments should not explain the code. It should explain what the code does not explain!
33:40
If the delete button is the only button that runs the code to deal with the selection issue, why not just have it in the delete click event handler? Does it really need a separate function if nothing else is going to use it?
I was wondering what is the keys you hinting or shortcut to get the comments?!
Shouldnt delete – > delete all selected values if u select more then 1 ?
Hello, thank you for your video, i learned a lot specially from the first part of this video. I'd like to follow everything you do in the video but when i encountered this -> https://photos.app.goo.gl/DWs51ij9ewryxKj58 i don't know what to do next. It looks very different from your result. I don't have any previous experience/background in programming, that's why i have no idea what to do. Please help me. i want to finish this Basic Calculator Project. Thank you Very Much.
Thanks man
a textbox has its own clear function. just do this.UserInputText.Clear();
Could we just use a single event method to add text to text field?
We could just take the text from the button which was clicked using:
string s = (sender as Button).Text;
and simply call the insertTextValue(s) method with the button text as parameter.
We could avoid using so many methods.
There are far too many comments, in my opinion. I enjoy your videos, but I don't see the point of commenting things that are self-evident. Based on everything I've read, the number of comments in your code seems like overkill.
Is there any disadvantage to creating the buttons with a button array? That could also save code.
Thank you, it was very helpful
Instead of passing hardcoded value to InsertTextValue method you could have used the Text property of a button. Another improvement would be to use the same handler for all the buttons and retrieve the Text property from sender parameter. I really like your tutorials!