Search code examples
c#winformsonmouseoverlinklabel

C# LabelLink LinkArea detection for mouse position


Is there a way to determine if the mouse is within the LinkArea of a LinkLabel control in C#?

Any help would be greatly appreciated.


Solution

  • You can use Mouse Enter Event

    linkLabel1.MouseEnter += new EventHandler(linkLabel1_MouseEnter);
    
    private void linkLabel1_MouseEnter(object sender, EventArgs e)
    {
        MessageBox.Show("Mouse is within link area");
    }