最新下载
热门教程
- 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)
相关文章
- 英雄联盟手游婕拉玩法指南 07-02
- 知识:如何玩转Blum并获得Blum空投?赚取BLUM币新手指南 07-02
- LazPad:为启动而生,为玩法而建 07-02
- 逆水寒白发梅梢暮雪外观如何获取 07-02
- 死亡搁浅2NPC升星技巧分享 07-02
- 卡普空制作人亲自解释为什么里昂不是《生化危机9:安魂曲》主角! 07-02