text box RRS feed

  • Question

  • Hello

    I have a text box on my form1 and in my form1.h:

    private: System::Void txtLoops_TextChanged(System::Object^  sender, System::EventArgs^  e) {

    What it has to do:

    When you enter a number in the text box it should be saved in the variable "amountofloops"

    How to do that?

    Best Regards
    • Edited by Joriek Wednesday, June 6, 2012 2:15 PM
    Wednesday, June 6, 2012 2:14 PM


  • Sounds like a homework assignment.

    Clearly you need to have a static member variable in the Form1 class. The number in the text box needs to be converted from a string to an int.

    Check out the Int32::TryParse() function.

    • Proposed as answer by Helen Zhao Friday, June 8, 2012 3:04 AM
    • Marked as answer by Helen Zhao Thursday, June 14, 2012 2:49 AM
    Wednesday, June 6, 2012 3:07 PM