PowerShell GUI - Hide actual URLs in RichTextBox

Ask questions about creating Graphical User Interfaces (GUI) in PowerShell and using WinForms controls.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Locked
re1313ixk
Posts: 4
Last visit: Tue Sep 14, 2021 2:07 am
Has voted: 1 time

PowerShell GUI - Hide actual URLs in RichTextBox

Post by re1313ixk »

I published a GUI that had a RichTextBox control and enabled multiple URLS in it by adding $output.add_linkclicked({Start-Process -FilePath $_.linktext}).

Hyper links worked, however, actual URLs are shown like below. I'd like to know how to hide the actual URLs. Do we have any way to do it?

Click here! <actual link>

Thank you.

jvierra
Posts: 14952
Last visit: Fri Oct 22, 2021 4:25 pm
Answers: 14
Has voted: 3 times
Been upvoted: 11 times

Re: PowerShell GUI - Hide actual URLs in RichTextBox

Post by jvierra »

The following will show how to make a text tagged URL.

https://stackoverflow.com/questions/285 ... -hyperlink

Here is how to use an object: https://stackoverflow.com/questions/123 ... -paragraph

jvierra
Posts: 14952
Last visit: Fri Oct 22, 2021 4:25 pm
Answers: 14
Has voted: 3 times
Been upvoted: 11 times

Re: PowerShell GUI - Hide actual URLs in RichTextBox

Post by jvierra »

A little investigation shows that you cannot create hidden text in the RichTextControl. This may be for security reasons.

Locked