Determining text boxes to be outputs

Quantum7 21 Reputation points

I'm running visual studio 2017 with visual c++. I think my text box inputs work. So far, there are no more errors detected by the compiler. I'm just not getting any results on my output text boxes. I think there should be some other command or something to determine my output text boxes to be outputs.

Here is an example of one of my inputs:

    String^ in1;
    System::Windows::Forms::TextBox^ textBox1 = gcnew System::Windows::Forms::TextBox;
    textBox1->Text = in1;

Here is an example of one of my outputs:

    String^ out1 = Convert::ToString(etresult);
    System::Windows::Forms::TextBox^ textBox6 = gcnew System::Windows::Forms::TextBox;
    textBox6->Text = out1;

What should I do next with my code to make the output text boxes work?

A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
2,882 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Jeanine Zhang-MSFT 5,661 Reputation points Microsoft Vendor


    I suggest you could try the following code:

     String^ out1 = Convert::ToString(etresult);  
     textBox6->Text = out1;  

    When you add controls to the form, vs will automatically add the following statements:

    private: System::Windows::Forms::TextBox^  textBox6;  
    this->textBox6 = (gcnew System::Windows::Forms::TextBox());  

    So you didn’t need to repeat by yourself :

    System::Windows::Forms::TextBox^ textBox6 = gcnew System::Windows::Forms::TextBox;  

    Best Regards,


    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments