Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/arrays/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows 自动转到多行文本框的下一行_Windows_Arrays_Winforms_Powershell - Fatal编程技术网

Windows 自动转到多行文本框的下一行

Windows 自动转到多行文本框的下一行,windows,arrays,winforms,powershell,Windows,Arrays,Winforms,Powershell,我有一个windows窗体,我在其中更新powershell中的文本,就像脚本进度状态一样,我试图自动移动到文本框中的新行,但我无法这样做 我尝试了[System.Environment]::新行,但没有成功 $nl=[System.Environment]::换行符 $i++ $textbox1.Text=“PS$i>运行脚本” $textbox1.AppendText($nl) 你们谁能帮我把光标自动移到下一行吗 也许表演 PS2>脚本已启动请尝试以下操作: $nl = "`r`n" $i

我有一个windows窗体,我在其中更新powershell中的文本,就像脚本进度状态一样,我试图自动移动到文本框中的新行,但我无法这样做

我尝试了[System.Environment]::新行,但没有成功

$nl=[System.Environment]::换行符

$i++

$textbox1.Text=“PS$i>运行脚本”

$textbox1.AppendText($nl)

你们谁能帮我把光标自动移到下一行吗 也许表演

PS2>脚本已启动

请尝试以下操作:

$nl = "`r`n"
$i++
$textbox1.Text = "PS $i> Running Script"
$textbox1.AppendText($nl)
我找到了这个解决方案

$textbox1.AppendText("PS $i> Running Script`r`n")

说真的?我无法解释这种行为,除非在写入该文本框之前,有某种东西会将U+000a转换为
\n
,将U+000d转换为
\r