[DllImport("user32.dll")]
static extern bool TrackMouseEvent(ref TRACKMOUSEEVENT lpEventTrack);
None.
None.
Please add some!
// C#
// Sets the hover time to 3sec and resets MouseEnter so the cursor does not have to
// leave the control to hover again
[DllImport("user32.dll")]
static extern int TrackMouseEvent(ref TRACKMOUSEEVENT lpEventTrack);
[StructLayout(LayoutKind.Sequential)]
public struct TRACKMOUSEEVENT
{
public UInt32 cbSize;
public UInt32 dwFlags;
public IntPtr hwndTrack;
public UInt32 dwHoverTime;
}
TRACKMOUSEEVENT tme;
protected override void OnMouseHover(EventArgs e)
{
OnMouseEnter(e);
base.OnMouseHover(e);
}
protected override void OnMouseEnter(EventArgs e)
{
base.OnMouseEnter(e);
tme = new TRACKMOUSEEVENT();
tme.hwndTrack = this.Handle;
tme.cbSize = (uint)Marshal.SizeOf(tme);
tme.dwFlags = TME_HOVER;
tme.dwHoverTime = 1000 * 3;
TrackMouseEvent(ref tme);
}
The Control.MouseEnter, Control.MouseLeave and Control.MouseHover events.