OnMouseEnter not functioning the way I expected?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?R29yZnk=?=

    #1

    OnMouseEnter not functioning the way I expected?

    Hey all, having an interesting time understanding this custom button class I
    am making. Here is a section of the code:

    protected override void OnMouseEnter(Ev entArgs e)
    {
    base.OnMouseEnt er(e);

    if (pulsingStart == false)
    {
    pulsingStart = true;
    }
    }



    protected override void OnMouseLeave(Ev entArgs e)
    {
    base.OnMouseLea ve(e);
    StopPulsing();
    }


    protected override void OnMouseMove(Mou seEventArgs e)
    {
    base.OnMouseMov e(e);

    if (pulsingStart == true)
    {
    pulsingStart = false;
    StartPulsing();

    Invalidate();
    Update();
    }
    }

    This works perfectly... but only after I click on the button!! It's like I
    have to "activate" the control by clicking on it for this functionality to
    work properly. I want this button to pulse when the mouse rolls over it,
    regardless of whether or not the user has clicked it yet. There will be many
    of these buttons on the stage, and they should all function the same; when
    the user's mouse rolls over them, they pulse, and when they roll off, it
    stops.

    Thanks so much in advance.
Working...