I am using an output into a rich text box.
I had my buttons output working with single action button output into textbox.
All my buttons are mostly just local pc information gathering.
My button codes almost all look like this:
Code: Select all
$buttonInstalledLocalPrinte_Click={
#TODO: Place custom script here
$richtextbox1.Text =
Get-Printer -ComputerName $Env:Computername | Out-String
}
Code: Select all
$buttonInstalledLocalPrinte_Click={
#TODO: Place custom script here
$richtextbox1.SelectAll();
$richtextbox1.Copy();
$richtextbox1.Text =
Get-Printer -ComputerName $Env:Computername | Out-String
$richtextbox1.Paste()
}
I am not a coder so please excuse the bade code, but, it does add the previous output and the new output.
Problem: Sometimes it adds red text and sometimes white text. It depends, or so it seems to depend on what button I am clicking on and what order.
It there a way someone can lead me in the right direction?
Honestly, it would work if I could just force Black Text on every output return to the rich text box.