最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
About LinkLabel
时间:2022-07-02 11:35:46 编辑:袖梨 来源:一聚教程网
[C#]
// 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)
// 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)
相关文章
- 微信文件传输助手-网页版入口及使用技巧 01-24
- 禁漫jmcomic官网直达-2026jmcomic禁漫最新传送门地址 01-24
- 学信网登录入口-官网查学历认证查询 01-24
- 韩剧再婚皇后全集百度云网盘资源链接分享-韩剧再婚皇后1080p蓝光百度云网盘资源下载 01-24
- 千牛工作台-网页版快捷登录入口 01-24
- farfetch官网直达-farfetch网页版快捷链接 01-24