How to get buttons or link label to use web browser box for websites?

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 4 years and 9 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
User avatar
shiroscout
Posts: 41
Last visit: Sat Jul 15, 2023 7:13 pm

How to get buttons or link label to use web browser box for websites?

Post by shiroscout »

Hello,

I have a page, with 4 menu items, which will be weburl links.
I'm using the web browser box, snippet of code is

Code: Select all

$webbrowser1_DocumentCompleted=[System.Windows.Forms.WebBrowserDocumentCompletedEventHandler]{
#Event Argument: $_ = [System.Windows.Forms.WebBrowserDocumentCompletedEventArgs]
	https://www.dell.com/support/incidents-online/us/en/04/ContactUs/Dynamic?changeServiceTag=True
}
I'm not sure what method I need to use to make this happen?
I thought I would be using an even but I keep getting errors and cannot figure out what I'm doing wrong?
Thank You,

Wayne
User avatar
shiroscout
Posts: 41
Last visit: Sat Jul 15, 2023 7:13 pm

Re: How to get buttons or link label to use web browser box for websites?

Post by shiroscout »

Hello,

After many mistakes, I tried:

Code: Select all

$linklabelDellChatSupport_LinkClicked=[System.Windows.Forms.LinkLabelLinkClickedEventHandler]{
#Event Argument: $_ = [System.Windows.Forms.LinkLabelLinkClickedEventArgs]
	#TODO: Place custom script here
	$webBrowser1.Navigate("https://www.dell.com/support/incidents-online/us/en/04/ContactUs/Dynamic?changeServiceTag=True");
}
and I got it to navigate to the url I wanted.
User error as usual>> Me.
Thank You,

Wayne
This topic is 4 years and 9 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