Links in strip menu

1

Is it possible to link to some site on the Windows Forms Strip Menu?

Ihavethefollowingcodesnippetintheclickofmymenu,butitdoesnotopenthelink.

privatevoidmenuSobre_Click(objectsender,EventArgse){WebBrowserwebBrowser1=newWebBrowser();webBrowser1.Document.Window.Open("http://www.meusite.com.br","_blank", "location", true);
}

What should I do?

    
asked by anonymous 27.01.2017 / 13:32

2 answers

1

Natively this does not exist, but it is relatively simple to work on a solution using the class Process and the click event of MenuItem .

As long as the links start with link the Process.Start() will open the default browser directly at this address.

It is important to remember to include the namespace System.Diagnostics .

See:

private void ToolStripMenuItem_Click(object sender, EventArgs e)
{
    var menuItem = (ToolStripItem)sender;
    var link = menuItem.Text;

    Process.Start(link);
}
    
27.01.2017 / 13:47
1

As far as I know, natively you can not make it a link in fact, but you can do code for your application to open the browser with that URL.

Ex:

System.Diagnostics.Process.Start("http://www.website.com");

Original post

    
27.01.2017 / 13:34