المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : Repositioning the cursor



C# Programming
03-31-2010, 08:01 AM
Hello,
I am looking for ways to reposition the cursor when I am clicked on the first menu item from a form menu. It should create a jumping effect so the user doesn't have to scroll through the other menus which don't have a child menu.

for example.... one file menu has 4 items. Namely 1, 2, 3, 4 now only item 2 has child menu items. namely 2.1, 2.2, 2.3. I want the cursor to be on 2.1 when the user brings the mouse on 2.

Please let me know how to do that. I am trying the following:


private void toolStripMenuItem2_MouseHover(object sender, EventArgs e)
{
toolStripMenuItem2.ShowDropDown();
Point LocalMousePosition_1 = this.PointToClient(Cursor.Position);
System.Windows.Forms.Cursor.Position = new Point(500, 500); //This just repositions the cursor to 500,500 position but not in the net child menu. This is where I am stuck.
//Point LocalMousePosition_2 = toolStripMenuItem2_1.PointToClient(Cursor.Position);
MessageBox.Show(LocalMousePosition_1+"Happy New Year to DOTNETSPIDER.COM guys");
}