Sorry the audio sucks; think the baby monitor was interfering w/ my mic. I think it's OK to hear, but you may have to turn your volume up. Sorry bout that.
Thank you for an excellent tutorial. This really helped me so much with coming to grips with the basics of c# programming and correctly using classes. I used a class library and referenced it to my project so that i can use the library for future projects. Very useful, thanks again!
Great tutorial, thanks for sharing! I have noticed that the sqrt function is a little buggy if you were doing some math in the beginning and want to add the root of a number. I often get weird behavior, especially when I do another operation after that. Now, I fixed this by moving everything after the handling of a sqrt in the case value != 0 into an "else" case. My code looks like this: if (b.Text == "sqrt") result.Text = Math.Sqrt(Double.Parse(result.Text)).ToString(); else { equals.PerformClick(); operation_pressed = true; operation = b.Text; equation.Text = value + " " + operation; }
numbers are appending to the result after an arithmetical expression has been made ex 3 +1 = 4 then I press some arbitrary number 11 for ex result is now 411. help to correct, please.
+Chris Merritt ok, i was doing pretty good to the very end. in my form1.cs under the private void operator_click where im trying to type Result.Text = Operators.sqrt(Double.Parse(Result.Text)).ToString(); im getting an error that says the best overloaded method match has some invaled arguments. also what am i supposed to put under the Operator.cs for public static int sqrt(int n1, int n2) { return Math.Sqrt(n1);/i dont know what to put here? } public static Double sqrt(int n1) { return Math.Sqrt(n1);//i dont know what to put here? } i'm probably going to have to watch this again. I got lost at the end
+Stanley Overby i figured it out. i had int where i was supposed to have double in the operator class program. i would like to learn how to add in feet and inches buttons & also slope, rise & run, i want to be able to add 6feet 4 inches + 4 feet 2 inches & have it return the correct result. I have a mobile app that does this
i tried to make the equal be pressed when i press the enter key but it's not working, and i notice that if i click with the mouse on the result line i can type there every thing how can i cancel that?
+george wright Hi George, just go into your Win_Calc\bin\Debug folder and locate the exe file. That is all you need. You can send that single file to another Windows computer and the calculator will run.
hello there. thanks for the videos. it helps me a lot.... I am a beginner and I can understand your tutorial. btw I want to know how to change the color of the X/O text. I tried changing the forecolor but it doesnt seems to do anything.
Sakyawira Nanda Ruslim, Forecolor is the right value to change. I just opened the project and opened Form1 in design mode, selected button A1, and then went over to properties and change the forecolor to a different color. That worked for me. I changed it to red. Then when I mouse over the button, the X or O is red.
Not unless you are overriding the forecolor value of the button somewhere else in your code? Do a search for "forecolor" in your code behind and see if you find anything. It's been a while since I did this, so I can't recall if we manually set forecolor somewhere or not.
Just take the current value in the input field and multiply by itself. The windows calculator works like this so, for example, 5 ^2 =25 (because 5 * 5 = 25) and 5 + 5 ^2 = 30 (because 5 + (5 * 5) = 30) it's only reading the current input field and multiplying by itself.
Hi Dear. Thank you for videos. They help me a lot. But you have a few mistakes. For example you don't need two methods for each operator, because "value" always is double type
Old comment I know but in case you come back to read this really all you need to do is have a variable store your memory value when you hit MS, recall that variable when you hit MR and zero it when you hit MC.
can some one please help me please i have calculator working but if i enter 9 for sqrt i get 9 back it should be 3 like in the video. my code is identical i cant figure it out can some please help me thanks
i'am looking to a tutorial where we you make us an app a pos (point of sells) for example that has db that you can install in one click and you can print the receipt and the products that you bought thank you very much
i think your one of the best people on youtube who describe so well
Sorry the audio sucks; think the baby monitor was interfering w/ my mic. I think it's OK to hear, but you may have to turn your volume up. Sorry bout that.
Thank you for an excellent tutorial. This really helped me so much with coming to grips with the basics of c# programming and correctly using classes. I used a class library and referenced it to my project so that i can use the library for future projects. Very useful, thanks again!
i got it working after all thanks Chris now i have a fully working calculator
Great tutorial, thanks for sharing!
I have noticed that the sqrt function is a little buggy if you were doing some math in the beginning and want to add the root of a number. I often get weird behavior, especially when I do another operation after that. Now, I fixed this by moving everything after the handling of a sqrt in the case value != 0 into an "else" case.
My code looks like this:
if (b.Text == "sqrt")
result.Text = Math.Sqrt(Double.Parse(result.Text)).ToString();
else
{
equals.PerformClick();
operation_pressed = true;
operation = b.Text;
equation.Text = value + " " + operation;
}
Hi Chris Merritt, why does the program throw an exception when i try to calculate something like 3.5*...?
in case you divide by 0, how did you use the exception System.DivideByZeroException ?
I need that too
numbers are appending to the result after an arithmetical expression has been made ex
3 +1 = 4 then I press some arbitrary number 11 for ex result is now 411.
help to correct, please.
+Chris Merritt
ok, i was doing pretty good to the very end. in my form1.cs under the private void operator_click where im trying to type Result.Text = Operators.sqrt(Double.Parse(Result.Text)).ToString(); im getting an error that says the best overloaded method match has some invaled arguments. also what am i supposed to put under the Operator.cs for
public static int sqrt(int n1, int n2)
{
return Math.Sqrt(n1);/i dont know what to put here?
}
public static Double sqrt(int n1)
{
return Math.Sqrt(n1);//i dont know what to put here?
}
i'm probably going to have to watch this again. I got lost at the end
+Stanley Overby i figured it out. i had int where i was supposed to have double in the operator class program. i would like to learn how to add in feet and inches buttons & also slope, rise & run, i want to be able to add 6feet 4 inches + 4 feet 2 inches & have it return the correct result. I have a mobile app that does this
Any Idea on how to create a Conversion radio button in a groupbox to toggle the result as a binary or decimal. Thanks
what is syntex of button 'CE'
How do u do code with other unary operators eg sin cos tan….?
thank you..very nice videos
Hi. Is there any way I can get a link to the vidio where you start building the calculator from zero? Thanks!
th-cam.com/video/Is1EHXFhEe4/w-d-xo.html
Thank you Chris. You rock! I´m taking programming classes at University and your videos have helped me a lot. Please keep sharing your knowledge.
microsoft's calculator can show numbers upto infinite in the label. how to do this?
OK how and from where u added these codes and did it work.I think u missed a video to post.I am not understanding what u are showing.Please show
i tried to make the equal be pressed when i press the enter key but it's not working, and i notice that if i click with the mouse on the result line i can type there every thing how can i cancel that?
click on textbox, go to properties, change ReadOnly to True.
King Darius You just got me an extra 3% on my grade, thanks!
The answer cant be a decimal ?? Plz help
Can you make a video about how to save project and how to strart it without visual studio
+george wright Hi George, just go into your Win_Calc\bin\Debug folder and locate the exe file. That is all you need. You can send that single file to another Windows computer and the calculator will run.
do you have a original file to download, pls?
hello there. thanks for the videos. it helps me a lot.... I am a beginner and I can understand your tutorial. btw I want to know how to change the color of the X/O text. I tried changing the forecolor but it doesnt seems to do anything.
Sakyawira Nanda Ruslim, Forecolor is the right value to change. I just opened the project and opened Form1 in design mode, selected button A1, and then went over to properties and change the forecolor to a different color. That worked for me. I changed it to red. Then when I mouse over the button, the X or O is red.
Chris Merritt hmmm thanks for replying. I'll try that again. But Any ideas why that doesnt work?
Not unless you are overriding the forecolor value of the button somewhere else in your code? Do a search for "forecolor" in your code behind and see if you find anything. It's been a while since I did this, so I can't recall if we manually set forecolor somewhere or not.
How would you add the operation of x^2 ?
Just take the current value in the input field and multiply by itself. The windows calculator works like this so, for example, 5 ^2 =25 (because 5 * 5 = 25) and 5 + 5 ^2 = 30 (because 5 + (5 * 5) = 30) it's only reading the current input field and multiplying by itself.
Hi Dear. Thank you for videos. They help me a lot. But you have a few mistakes.
For example you don't need two methods for each operator, because "value" always is double type
you can help me to button MC,MS,MR??
Old comment I know but in case you come back to read this really all you need to do is have a variable store your memory value when you hit MS, recall that variable when you hit MR and zero it when you hit MC.
you can give me the code file does not?
Hi! simple code for sqrt: private void button1_Click(object sender, EventArgs e)
{
double sq = Double.Parse(textBox_Results.Text);
labelcurrentOperation.Text = System.Convert.ToString("sqrt" + "(" + (textBox_Results.Text) + ")");
sq = Math.Sqrt(sq);
textBox_Results.Text = System.Convert.ToString(sq);
Wow that's a lot easier. Thanks!
when i use "sqrt" and than i use for example + there is error
or if I try to use "sqrt" after any other function
can some one please help me please i have calculator working but if i enter 9 for sqrt i get 9 back it should be 3 like in the video. my code is identical i cant figure it out
can some please help me thanks
Fail. 0 didt work.
the audio realy sucks
what are you waiting to make it again, i'm just kidding thank you
please make us a real app with a local database
thank you
It does suck, sorry!! Anything in particular you're looking for in terms of local DB app?
i'am looking to a tutorial where we you make us an app a pos (point of sells) for example that has db that you can install in one click and you can print the receipt and the products that you bought
thank you very much
i cant hear anything
the other videos was much better
The answer cant be a decimal ?? Plz help