Page 1 of 1

Display log function to textbox

Posted: Thu Nov 08, 2018 6:37 am
by chexmix
I have a log function that I call in various places in my script. How would I output this to a textbox?



log -l "Mail property detected"
log -l "City property detected"
log -l "Unable to set property: $($p.name)"

Re: Display log function to textbox

Posted: Thu Nov 08, 2018 7:57 am
by Alexander Riedel
You add the log entry to the text property of the textbox.
$Textbox1.Text += "Your new log entry"
You might want to throw in new lines and other formatting aids.

I would start with familiarizing myself with the various controls and how to use them.
https://info.sapien.com/index.php/guis/gui-controls

If you have any further questions regarding GUI design, please post in the PowerShell GUI section of the forum. It is open to everyone.

Re: Display log function to textbox

Posted: Thu Nov 08, 2018 10:04 am
by chexmix
That works for a string of text but how do I use the function like I had asked.

Re: Display log function to textbox

Posted: Thu Nov 08, 2018 10:24 am
by Alexander Riedel
I don't know what your log function does. You would probably need to rewrite that to do what I implied.
I suggest to post in the PowerShell GUI section and provide a little more detail.

Re: Display log function to textbox

Posted: Thu Nov 08, 2018 10:58 am
by chexmix
I'm trying it out thats why I posted in the trail software section. The PowerSehll GUI section is for registered products only.

Re: Display log function to textbox

Posted: Thu Nov 08, 2018 12:09 pm
by J. Reif
Hi chexmix!

The PowerShell GUIs forum is open to anyone with a SAPIEN account - it is not restricted to people with registered products. You can find the forum here: https://www.sapien.com/forums/viewforum.php?f=21