3 Answers, 1 is accepted
If I understand your requirement correctly, you want to close the form once the user moves the mouse outside the form's bounds. For this purpose, you can refer to the following Stack Overflow thread which is quite useful on this topic: https://stackoverflow.com/questions/15974258/close-application-when-mouse-leaves-form
However, if it is not the exact requirement, please give us some more details about the exact requirement that you are trying to achieve. Thus, we would be able to think about a suitable solution and assist you further. Thank you in advance.
I hope this information helps. If you need any further assistance please don't hesitate to contact me.
Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik
Hi Dess,
I have one radgridview. When I do mouse hover of the row , I want to open other form(FrmProcess). After mouse move out , I want to close the form(FrmProcess). I saw alot of mouseover event function other topic . But this event is not useful for me. I want mousehover event function.
Thanks
Moe
Hello, Moe,
In order to achieve your goal, you can handle the MouseMove event that RadGridView offers and detect what is the visual cell element under the mouse. Store the last hovered row and if it changes indicate the another row is hovered. You can find below a sample code snippet. Note that this is just a sample approach and it may not cover all possible cases. Feel free to modify it in a way which suits your requirements best:
GridViewRowInfo lastHoveredRow = null;
private void radGridView1_MouseMove(object sender, MouseEventArgs e)
{
GridCellElement cellElement = this.radGridView1.ElementTree.GetElementAtPoint(e.Location) as GridCellElement;
if (cellElement != null)
{
if (lastHoveredRow != null)
{
if (lastHoveredRow != cellElement.RowInfo)
{
Console.WriteLine("Out >> " + lastHoveredRow.Index);
Console.WriteLine("In >> " + cellElement.RowInfo.Index);
}
}
lastHoveredRow = cellElement.RowInfo;
}
}
I hope this information helps.
Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik