In the textblock i get "Procent used: 0" no matter wath i write in the textblocks and when i debug the application i se that the both the integers are 0.
I'm not in a location to try this out, but if you put a .toInt() after the .Text of your boxes, will it work? Or perhaps you have to put the .Text values in string variables first, and then toInt() the strings.
In the textblock i get "Procent used: 0" no matter wath i write in the textblocks and when i debug the application i se that the both the integers are 0.
There are 2 problems here. First, you're using integer math. If you divide an int by an int, the result will always come back as an int. For example, if you divide 1/2, the "real" answer is 0.5, but that gets casted to an int, which causes it to lose the decimal place, so you end up with 0. But if either the dividend or divisor is a float then floating point math will be used. Try casting one of the ints to a float like this:
(float)dataUsed / int.Parse(dataPerMonthTextBox.Text)
The second problem is that you're using an int to store the result. As I mentioned above, the int type does not store decimal places. Try changing the procentUsed variable to a float instead.
I'm not in a location to try this out, but if you put a .toInt() after the .Text of your boxes, will it work? Or perhaps you have to put the .Text values in string variables first, and then toInt() the strings.