2012-07-19 98 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