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.
Post Reply
User avatar
re1313ixk
Posts: 1
Last visit: Mon Apr 12, 2021 1:49 am

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: 14762
Last visit: Mon Apr 19, 2021 4:16 pm
Answers: 9
Has voted: 3 times
Been upvoted: 7 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: 14762
Last visit: Mon Apr 19, 2021 4:16 pm
Answers: 9
Has voted: 3 times
Been upvoted: 7 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.

Post Reply