Skip to content

Panel Header BackColor on MouseHover #389

Closed

Description

@itg-assistant

Cris asked 2016-11-15 18:47:32 UTC

Hi,

I am trying to look for way on how to change the BackColor of a Panel Header on MouseHover specifically when Collapsed=true but can't find any. There are MouseEnter, MouseLeave and MouseHover but they all apply to the body of the Panel.

Is it possible or I am just missing something that is not so obvious?

Thanks

Activity

  1. itg-assistant commented on Jun 12, 2026

    @itg-assistant
    Author

    Luca answered 2016-11-16 17:38:02 UTC

    Hi Cris,

    I tried both MouseEnter and MouseHover on the header of a collapsed panel and get the events back in both cases. Are you attaching to the event or using OnMouseHover?

    /Luca

  2. itg-assistant commented on Jun 12, 2026

    @itg-assistant
    Author

    Cris answered 2016-11-18 18:27:12 UTC

    Hi Luca,

    Yes, both MouseEnter and MouseHover work so with MouseLeave. But they only work on the body of the Panel. What I am looking for is an event when the mouse is over the Header of the Panel or thru javascript.

    I am using a simple code as:

    private void panel2_MouseLeave(object sender, EventArgs e)
    {
        panel2.BackColor = System.Drawing.Color.White;
    }
    
    private void panel2_MouseEnter(object sender, EventArgs e)
    {
        panel2.BackColor = System.Drawing.Color.BlanchedAlmond;
    }
    
    Thanks and have a nice weekend.
    
  3. itg-assistant commented on Jun 12, 2026

    @itg-assistant
    Author

    Luca answered 2016-11-18 18:39:19 UTC

    Hi Cris, the issue is that MouseEnter and MouseLeave don’t fire when the pointer is over the header? That’s what I have tried. http://demo.wisej.com/apps/paneltest.html

  4. itg-assistant commented on Jun 12, 2026

    @itg-assistant
    Author

    Cris answered 2016-11-18 18:45:17 UTC

    Hi Luca,
    I got the same behaviour in my test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    GeneralQuestions, how-tos and everything else.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions