Mouse enter / Mouse leave in C #

0

How do I remove the blue color that the menu has by default when I mouse over an option?

This is what I did but it does not remove the sky blue color.

private void menuoperario_MouseEnter(object sender, EventArgs e)
    {
        filemenu.Font = new Font("Segoe UI", 9.75f, FontStyle.Bold);
        requestmenu.Font = new Font("Segoe UI", 9.75f, FontStyle.Bold);
        menuoperario.Font = new Font("Segoe UI", 12.75f, FontStyle.Bold);
        menuoperario.ForeColor = Color.Orange;
        menuoperario.BackColor = Color.Black;
    }

    private void menuoperario_MouseLeave(object sender, EventArgs e)
    {
        filemenu.Font = new Font("Segoe UI", 9.75f, FontStyle.Bold);
        requestmenu.Font = new Font("Segoe UI", 9.75f, FontStyle.Bold);
        menuoperario.Font = new Font("Segoe UI", 9.75f, FontStyle.Bold);
        menuoperario.ForeColor = Color.Black;
        menuoperario.BackColor = Color.Transparent;
    }
    
asked by use2105 26.12.2016 в 16:30
source

1 answer

0

The following solution removes the border of your control:

menuoperario.TabStop = false;
menuoperario.FlatStyle = FlatStyle.Flat;
menuoperario.FlatAppearance.BorderSize = 0;
menuoperario.FlatAppearance.BorderColor = Color.FromArgb(0, 255, 255, 255); //transparente
  

NOTE: I did tests on a Button element. With the Label element, I had no problems with the edges.

    
answered by 23.05.2017 в 14:39