I have only been diving into the C# language for roughly 3 days. I have alot of background with computers but never in a programming language. I am attempting to gain a foothold in C# by playing with it to learn a little about how it works before returning to my books that seem to think I already know a language. But I ran into a snag, I have a picture called bowPic1, I added MouseLeftButtonDown="bowPic1Click", my intention was to take the integer from a text box that I have and add 2 to it, but I dont want it to happen twice if I click twice, I want the click to be limited to one time unless the MouseRightButtonDown="bowPic1Click1" is done.
They way I am trying to accomplish this is below, but I cant come up with an equation that would limit it to 1 click because I cannot obtain the number from the text box and keep it constant for the following code:
private void bowPic1Click(object sender, MouseButtonEventArgs e)
{
if (bowPic1.Visibility == Visibility.Visible)
{
int cad = int.Parse(cadTextBox.Text);
int cad1 = cad + 2;
if (????????????????????)
cadTextBox.Text = cad1.ToString();
}
}
I know that since I am so fresh to doing this stuff that my question hardly merits a response, but I am grasping this pretty quickly and I do enjoy it alot.
If anyone can either tell me how to take that integer from cadTextBox and keep it contant for the if statement or if there is some other way to accomplish what I am aiming for, please let me know! I very much appreciate the assistance, and look forward to reading the responses.