Originally Posted by ZAIN View Post
int aantaltextBox = Convert.ToInt32(textBox.Text);
int limiet = Convert.ToInt32(textBox1.Text);
int aantallabel = Convert.ToInt32(label.Content=0);
while (aantallabel < limiet)
{
label.Content = aantallabel + aantaltextBox;
}

i think the problem with this code is that every time you click this button, it resets label to 0. so everytime you click the button, it does label.Content = numTextbox (user input) + numLabel (which is always 0). you only want the label to output 0 once, thats when the program starts.


label.Content = 0;

private void method1{
int numTextbox = Int32.Parse(numBox.Text);
int limit = Int32.Parse(limitBox.Text);
int numLabel = int32.Parse(label.Text);

if (numTextbox <= limit) label.Content = numTextbox + numLabel;
}
Ye i know, had already tried it before but it says: "The name 'label.Content' does not exist in the current context" and "The name 'label' does not exist in the current context. And i get a error by 'label.Text' i changed it to 'label.Content' but then i get a different error: "Argument 1: cannot convert from 'object' to 'string' "



- - - Updated - - -

Originally Posted by Paul View Post
It's not that bad, lol. I would choose it over Java. java is just annoying.

Also, if you're on OS X, why haven't you downloaded Xamarin to test?


Qais, if it's out of context, usually means one of the following things.

- Initialize the variable from another class (which you don't have).
- Make it an instance variable like I did.
- Declare the variable within' the same function. int firstbox;
Hmm even when it works, i still need 1 button though.. don't know how i could put that all into 1 button.