Home > Software engineering >  When the mouse after the drop-down menu, menu disappear after removed
When the mouse after the drop-down menu, menu disappear after removed

Time:10-11

When the mouse after the drop-down menu, menu disappeared after removing, how to implement, had better have the code examples

CodePudding user response:

 
Void MyButton: : onm ouseMove (UINT nFlags, CPoint point)
{
if(! M_tracking)
{
TRACKMOUSEEVENT tme.
Tme. CbSize=sizeof (tme);
Tme. DwFlags=TME_HOVER | TME_LEAVE;
Tme. DwHoverTime=1;
Tme. HwndTrack=m_hWnd;
M_tracking=_TrackMouseEvent (& amp; Tme);
}
//
If # 1
If (MK_LBUTTON==nFlags)
{
CRect rc;
GetClientRect (& amp; Rc);
MapWindowPoints (GetParent (), & amp; Rc);
MapWindowPoints (GetParent (), & amp; Point, 1);
MoveWindow (point. X-ray m_MouseLast. X, point. The y - m_MouseLast. Y, rc. The Width (), rc, Height ());
}
# endif
}
LRESULT MyButton: : onm ouseLeave (WPARAM WPARAM, LPARAM LPARAM)
{
//afxDump & lt; <"Leave \ n";
If (m_hover)
{
M_hover=false;
M_tracking=FALSE;
Invalidate ().
}
return 0;
}
//
LRESULT MyButton: : onm ouseHover (WPARAM WPARAM, LPARAM LPARAM)
{
//afxDump & lt; <"Hover \ n";
if(! M_hover)
{
M_hover=true;
M_tracking=FALSE;
Invalidate ().
}
return 0;
}

CodePudding user response:

M_MouseLast, where this

CodePudding user response:

 
Void MyButton: : OnLButtonDown (UINT nFlags, CPoint point)
{
//the transform left - top to point
CRect rc;
GetClientRect (& amp; Rc);
MapWindowPoints (GetParent (), & amp; Rc);
MapWindowPoints (GetParent (), & amp; Point, 1);
M_MouseLast. X=point. X-ray rc. Left;
M_MouseLast. Y=point. Y - rc. Top;
//afxDump & lt; //
CButton: : OnLButtonDown (nFlags, point);
}

CodePudding user response:

Binding MouseOver and MouseLeave trigger events

CodePudding user response:

Menu disappear is refers to the drop-down menu to recover, that is not really lost menu
If (MK_LBUTTON==nFlags)
{
CRect rc;
GetClientRect (& amp; Rc);
MapWindowPoints (GetParent (), & amp; Rc);
MapWindowPoints (GetParent (), & amp; Point, 1);
MoveWindow (point. X-ray m_MouseLast. X, point. The y - m_MouseLast. Y, rc. The Width (), rc, Height ());
}
This code make menu

CodePudding user response:

The mouse click, pop-up drop-down menu, and then move the mouse to the other button, a pop-up menu, move to the button, the button pop-up menu

CodePudding user response:

How can't the search functions of BBS by vc, vb, the jv plate to search
  • Related