Nevron Forum

MouseHover Event and the NNumericUpDown control

https://www.nevron.com/Forum/Topic3282.aspx

By Miles Thornton - Wednesday, March 24, 2010

I have a need to have my NNumericUpDown controls display a ToolTip specific to each one of them; but there is apparently no MouseHover Event... Am I missing something or is the functionality just not available?

I tried hooking up the NToolTip to the MouseClick, OnEnter Events - but, that doesn't seem to work:

private void nnud_Enter(object sender, EventArgs e)

{ // The ToolTip Text to display is held by each NNumericUpDown's Tag property:

int length = ((Nevron.UI.WinForm.Controls.NNumericUpDown)sender).Text.Length;

((Nevron.UI.WinForm.Controls.NNumericUpDown)sender).Select(0, length);

nttFixturesToolTipForNNUDs.Content.Text = ((Nevron.UI.WinForm.Controls.NNumericUpDown)sender).Tag.ToString();

nttFixturesToolTipForNNUDs.SetTooltip(((Nevron.UI.WinForm.Controls.NNumericUpDown)sender));

nttFixturesToolTipForNNUDs.ShowDelay = 10;

nttFixturesToolTipForNNUDs.HideDelay = 1000;

}

private void nnudFixtures_MouseClick(object sender, MouseEventArgs e)

{

EventArgs a = new EventArgs();

nnud_Enter(sender, a);

}

Thanks,

-Miles

By Angel Chorbadzhiev - Thursday, March 25, 2010

Hi Miles,

You should separately attach to the following events:

nNumericUpDown1.Controls[0].MouseEnter += new EventHandler(upDownButtons_MouseEnter);

nNumericUpDown1.Controls[1].MouseEnter += new EventHandler(editBox_MouseEnter);

... and in the event handlres to set to tooltip to the respective controls.

Regards,

Angel.