Change color in output to TextBox depending on error or not
Posted: Thu Apr 03, 2014 4:37 am
Hi,
I'm new to GUI-powershell scripts. Have made a GUI in Primal Forms for an AD-script I use to handle group-members. I log what happens to a TextBox ($LogBox). Now I would like to change the color of the log dependin if I get an error or not.
Have tried to search this forum and google it but cant find anything that would help me.
I can change color of everything in the textbox with $LogBox.forecolor = "red" but that is not what i want. I just want to change specific lines in the textbox. Not everything!
ex:
I'm new to GUI-powershell scripts. Have made a GUI in Primal Forms for an AD-script I use to handle group-members. I log what happens to a TextBox ($LogBox). Now I would like to change the color of the log dependin if I get an error or not.
Have tried to search this forum and google it but cant find anything that would help me.
I can change color of everything in the textbox with $LogBox.forecolor = "red" but that is not what i want. I just want to change specific lines in the textbox. Not everything!
ex:
PowerShell Code
Double-click the code block to select all.$LogBox.AppendText("***Error! Conputer: $Computer could not be found i AD"+[char]13+[char]10)Can anyone please help me with an example of how to make the line above be written in RED?