Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

adding Hyperlink in win app

I'm looking for a way to use hyperlinks in a winforms environment.

I found that it uses System.Web.UI.WebControls; but when i tried to use it in my program System.Web was as far as it would go. So I checked the refrences but also no System.Web.UI.WebControls or something like that, any sugestions?

like image 800
jorne Avatar asked Mar 08 '12 12:03

jorne


People also ask

How do I link a Label in Windows form?

To create a LinkLabel control at design-time, you simply drag and drop a LinkLabel control from Toolbox to a Form. After you drag and drop a LinkLabel on a Form. The LinkLabel looks like Figure 1. Once a LinkLabel is on the Form, you can move it around and resize it using mouse and set its properties and events.

How do you create a hyperlink?

Create a hyperlink to a location on the webSelect the text or picture that you want to display as a hyperlink. Press Ctrl+K. You can also right-click the text or picture and click Link on the shortcut menu. In the Insert Hyperlink box, type or paste your link in the Address box.

How do I add a link to my power app?

Manage web links in Power Apps portalsOpen the Portal Management app. Go to Portals > Web Link Sets. To create a new web link set, select New.

How do I create a hyperlink in Windows form?

Let's add a LinkLabel control to the form by dragging it from Toolbox and dropping it to the form. You will see that a LinkLabel 1 is added to the form. This control is now available to you in the code behind. Hyperlinks are sometimes useful in Windows Forms programs.


2 Answers

You can use LinkLabel control. Set text property of LinkLabel to show your web link. You can use "LinkClicked" event to open the web browser as shown below. Hope this helps you.

     private void linkLabel1_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
    {
        System.Diagnostics.Process.Start(linkLabel1.Text);
    }
like image 141
www.binaryStacks.com Avatar answered Nov 14 '22 22:11

www.binaryStacks.com


If your're developing a WinForms application you have to use System.Windows.Forms.LinkLabel control, located in System.Windows.Forms assembly. Controls in System.Web.* are for HTML pages.

like image 43
Adriano Repetti Avatar answered Nov 14 '22 21:11

Adriano Repetti