2012-07-19 132 views
1

我有一个LinkLabel,通过设置BorderStyle=none当我运行窗体时,它周围有一个薄边框。 我想从链接标签中移除这个薄边框。我怎样才能做到这一点?从Linklabel C删除边框#

的代码我LinkLabel的是

  linkLabel1.AccessibleRole = System.Windows.Forms.AccessibleRole.Alert; 
      linkLabel1.BackColor = System.Drawing.Color.Transparent; 
      linkLabel1.Font = new System.Drawing.Font("Tw Cen MT Condensed", 13F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); 
      linkLabel1.ForeColor = System.Drawing.SystemColors.HotTrack; 
      linkLabel1.LinkBehavior = System.Windows.Forms.LinkBehavior.NeverUnderline; 
      linkLabel1.LinkColor = System.Drawing.Color.RoyalBlue; 
      linkLabel1.Location = new System.Drawing.Point(129, 330); 
      linkLabel1.Name = "linkLabel1"; 
      linkLabel1.Size = new System.Drawing.Size(68, 21); 
      linkLabel1.TabIndex = 7; 
      linkLabel1.TabStop = true; 
      linkLabel1.Text = "Contact Us"; 
      linkLabel1.TextAlign = System.Drawing.ContentAlignment.TopCenter; 
      linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked); 

LinkLabel的代码输出截图 http://tinypic.com/r/20rk09v/6 LinkLabel的代码设计视图Scrrenshot http://tinypic.com/r/4kzj9y/6

+1

请给我展示的LinkLabel – HatSoft 2012-07-19 14:03:42

+0

大概看看属性的代码; bordercolor,borderwidth(或边界)这样的事情。 – 2012-07-19 14:05:03

回答

2

如何:

this.label.BorderStyle = System.Windows.Forms.BorderStyle.None 
+0

OP提到他已经设置了这个问题! – Bridge 2012-07-19 14:06:23

+0

这是如何完成的! – Gabe 2012-07-19 14:07:13

+0

我做了一样但没有实现这再次看到问题我已上传链接标签的详细代码 – user1366440 2012-07-21 06:54:34

8

如果你已经设置BorderStyle财产none,我想你是在谈论作为边界的链接下划线。如果是,您可以在属性中更改该行为。有一个名为LinkBehaviour的属性,您可以选择值为NeverUnderLine以避免下划线。

enter image description here

+0

+1 Ooooh,一张照片。现在是班级。 – Shibumi 2012-07-19 16:40:07

+0

我做了相同但未实现的再次看到此问题我已上传链接标签的详细代码 – user1366440 2012-07-21 06:53:08

+0

您可以将链接看起来像一个屏幕截图吗? – Shyju 2012-07-21 14:30:05