简体   繁体   中英

Remove Border from Linklabel C#

I have a LinkLabel , by setting BorderStyle=none there is a thin border around it when I run the Form. I want to remove this thin border from the linklabel. How can I achieve this?

The Code Of My Linklabel Is

            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 Code Output Screenshot http://tinypic.com/r/20rk09v/6 Linklabel Code Design View Scrrenshot http://tinypic.com/r/4kzj9y/6

If you already Set the BorderStyle property to none , I guess you are talking about the link underline as the border. If yes, you can change that behavior in the properties. There is a property called LinkBehaviour and you can select the Value to NeverUnderLine to avoid the underline.

在此处输入图片说明

怎么样:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM