Results 1 to 10 of 28

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    ZAIN's Avatar ʎlǝuol os ɯ,I

    Join Date
    Apr 2013
    Country
    Posts
    475
    Thanked
    83
    Thanks
    314
    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;
    }

  2. #2
    qais187's Avatar Junior Member

    Join Date
    Nov 2014
    Country
    Posts
    93
    Thanked
    110
    Thanks
    15
    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.


  3. #3
    qais187's Avatar Junior Member

    Join Date
    Nov 2014
    Country
    Posts
    93
    Thanked
    110
    Thanks
    15
    Originally Posted by yung View Post
    Java is even worse than C# why are you comparing shit to ebola...~
    C++, C, Rust and the new Swift are the only good programming languges.



    Ok, you're going way too far now, go and google the fkn shit because you don't know anything about C# at all wtf, this can't be your homework you're beyond helpless, if you can't do it on your own why are you asking for spoonfeed here? We've helped you more than enough to fix the problem which you write in the topic, now you want us to do the rest because you can't even use google or do your own homework.

    From topic: "Can someone tell me what i'm doing wrong here? I've looked the net for many hours without luck."

    Took me less than 5 mins to find a decent answer while I have almost 0 knowledge of C#, I learned more in those 5 minutes than you did in "many hours" and apparently even school. Your assignment was to copy a picture of a GUI? Without instructions or an example code to guide you? Or even the teachers example? So much bullshit dude...

    I hope this thread gets closed because you're basically asking for your homework to be done by this forum, but you're pretending there are unsolvable problems in the code, but in reality can be fixed within a minute just by googling.
    You really think i just gonna post some homework in a GAMEFORUM because you think im lazy? I've looked days/hours into this problem without luck. And like i said it a small problem of my hw(see example) i never said do the whole shit because i know the rest. What you did was using 2 buttons to solve(still had errors) it go ahead try to find it while using only 1 then talk. Like i said if you dont want to help i inderstand that but i dont need this shit talking from someone who thinks he all knows whats going on.
    Last edited by qais187; 10-17-2015 at 10:43 AM.


  4. The following user said thank you to qais187 for this useful post:

    Paul (10-17-2015)

Thread Information

Users Browsing this Thread

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