C# Adding Hyperlink to Windows Form z
2014-05-29 09:20
465 查看
When creating a Windows form in C#, we would like to create a hyperlink so that when the user click on the link it would open up a web browser and display the desire website.
In order to do so you will need to use the control LabelLink.
1. First drag the LinkLabel from the Toolbar onto the form.
2. Then double click on the LinkLabel control to open the LinkClicked event.
3. Inside the event place this code:
System.Diagnostics.Process.Start("www.itjungles.com");'
Example:
private void lnkITJungles_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
System.Diagnostics.Process.Start("www.itjungles.com");
}
In order to do so you will need to use the control LabelLink.
1. First drag the LinkLabel from the Toolbar onto the form.
2. Then double click on the LinkLabel control to open the LinkClicked event.
3. Inside the event place this code:
System.Diagnostics.Process.Start("www.itjungles.com");'
Example:
private void lnkITJungles_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
System.Diagnostics.Process.Start("www.itjungles.com");
}
相关文章推荐
- Using WPF DataGridHyperLinkColumn Items to open Windows Explorer and open files
- How to make Windows Form app truly Full Screen (and to hide Taskbar) in C#? 转
- Adding Hyperlink Capability to RichText Boxes
- Adding Hyperlink Capability to RichText Boxes
- How to use C# code to get the windows components
- How to Create a Notify Icon in C# without a form
- Adding Controls to Windows Forms at Runtime
- How to Integrate Excel in a Windows Form Application using the WebBrowser
- C# Windows Form 刷新父窗体
- How to submit an InfoPath form to a Windows SharePoint Services document library
- 用.net创建windows service的总结(C#代码)tojike(原作)
- 如何在win32控制台加入MFC对话框(Adding Windows To Your Console Application)
- C# Windows Form 下通过MethodInvoker 实现异步调用 (不使用thread)
- How to stretch a background image of a windows form
- C# 设置Windows 窗体的屏幕位置,动态创建的Form
- How to Make Dynamic Hyperlinks Using C# in ASP.NET
- How to pass a parameter to HyperLink in GridView/DataList
- C#WindowsForm拖拽事件一例bug分析
- Low-level Windows API hooks from C# to stop unwanted keystrokes
- Creating a immovable windows' form in c#