Results 1 to 10 of 28

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    qais187's Avatar Junior Member

    Join Date
    Nov 2014
    Country
    Posts
    93
    Thanked
    110
    Thanks
    15
    Originally Posted by Paul View Post
    Code:
    private void button_Click(object sender, RoutedEventArgs e)
            {
    
                int aantaltextBox = textBox.Text;
                int limiet = textBox1.Text;
                int aantallabel = label.Content=0;
                while (aantallabel < limiet)
                {
                    label.Content = aantallabel + aantaltextBox;
                }
    If both text boxes contain a number, there is no need to convert to integer because it has assigned itself as an int (or so it should be). You are also assigning it to an int variable.
    [nvm, now i have to use just other name thanks for the tip] No it doesn't work.. if you do for example textbox 1(40) + textbox 2(50)= 4050(you get this because its a string) you still need to convert.
    Last edited by qais187; 10-16-2015 at 07:43 PM.


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)