There is a cycle at the end of which the value is written to the textbox. I need to write the values ​​in a new line, and not overlap each other.

I tried this:

textBox2->Text = Environment::NewLine + m; 

Advance ATP.

    2 answers 2

    Replace = with += .

    UPD: Code

     textBox2->Text += Environment::NewLine + m; 

    where m is a string, should change the text inside the control, namely: add a line break and a string m . In order to see the results, the Multiline property must be set to true .

    Another option is to call the AppendText() method:

     textBox2->AppendText(Environment::NewLine + m); 
    • hmm so adds nothing at all - rif009
    • still not roby = ( - rif009
    • stupidly the result does not appear even though Multiline is set to true. - rif009

    Maybe someone will help: I ​​found this solution for Powershell, through the method AppendText. I think that is suitable for .net

     $button1_Click = {buttonclick} function buttonclick ($parameter1, $parameter2) { $b = "" $serv = Get-Process | where { $_.mainWindowTItle } | %{ $_.Name } ForEach ($a in $serv) { $a.ToString() $b = $a.ToString() + "`n" $textbox1.AppendText($b) }