最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
About LinkLabel
时间:2008-01-12 编辑:简简单单 来源:一聚教程网
// Create a new LinkLabel control.
private LinkLabel linkLabel1 = new LinkLabel();
public void InitializeMyLinkLabel()
{
// Set the control to autosize based on the text content.
linkLabel1.AutoSize = true;
// Position and size the control on the form.
linkLabel1.Location = new System.Drawing.Point(8,16);
linkLabel1.Size = new System.Drawing.Size(135,13);
// Set the text to display in the label.
linkLabel1.Text = "Click here to get more info.";
// Create a new link using the Add method of the LinkCollection class.
linkLabel1.Links.Add(6,4,"www.microsoft.com");
// Create an event handler for the LinkClicked event.
linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
// Add the control to the form.
this.Controls.Add(linkLabel1);
}
private void linkLabel1_LinkClicked(object sender, System.Windows.Forms.LinkLabelLinkClickedEventArgs e)
-
上一个: C#下实现动态系统托盘图标
-
下一个: 当然可以,给你个例子
相关文章
- C#复制数组的两种方式及效率比较解读 10-24
- ASP.NET Identity用法解析 10-24
- ASP.NET MVC使用Identity增删改查用户介绍 10-24
- C语言中atoi函数模拟实现介绍 10-18
- .Net反向代理组件Yarp用法介绍 10-10
- .NET使用YARP通过编码方式配置域名转发实现反向代理教程 10-10