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.
This topic is 2 years and 11 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
liankin128
Posts: 4
Last visit: Fri Mar 15, 2024 2:40 am
Has voted: 1 time

PowerShell GUI - Hide actual URLs in RichTextBox

Post by liankin128 »

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: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 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: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 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.
This topic is 2 years and 11 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked