Click here to Skip to main content
15,898,035 members
Home / Discussions / C#
   

C#

 
AnswerRe: Repositioning the cursor Pin
skhan1730-Mar-10 13:11
skhan1730-Mar-10 13:11 
AnswerRe: Repositioning the cursor Pin
Paw Jershauge30-Mar-10 13:24
Paw Jershauge30-Mar-10 13:24 
GeneralRe: Repositioning the cursor Pin
skhan1730-Mar-10 13:36
skhan1730-Mar-10 13:36 
GeneralRe: Repositioning the cursor Pin
Paw Jershauge30-Mar-10 13:40
Paw Jershauge30-Mar-10 13:40 
GeneralRe: Repositioning the cursor Pin
Paw Jershauge30-Mar-10 13:53
Paw Jershauge30-Mar-10 13:53 
GeneralRe: Repositioning the cursor Pin
PIEBALDconsult30-Mar-10 14:13
mvePIEBALDconsult30-Mar-10 14:13 
GeneralRe: Repositioning the cursor Pin
skhan1730-Mar-10 14:22
skhan1730-Mar-10 14:22 
AnswerRe: Repositioning the cursor Pin
Alan N30-Mar-10 15:19
Alan N30-Mar-10 15:19 
Hi,
Handle the DropDownOpening or DropDownOpened event that occurs when your child menu appears. The Location property will get the screen coordinates of the top left corner of the menu. Apply an offset to put the cursor into the centre of the first menu item.


private void MenuItem_DropDownOpening(object sender, EventArgs e) {
  ToolStripMenuItem menu = (ToolStripMenuItem)sender;

  Point p = menu.DropDown.Location;  // screen coords
  Rectangle r = menu.DropDown.Items[0].Bounds;
  p.Offset(r.Width / 2, r.Height / 2);
  Cursor.Position = p;
}


Alan.
GeneralRe: Repositioning the cursor Pin
skhan1730-Mar-10 15:38
skhan1730-Mar-10 15:38 
AnswerRe: Repositioning the cursor Pin
Som Shekhar30-Mar-10 18:38
Som Shekhar30-Mar-10 18:38 
GeneralRe: Repositioning the cursor Pin
skhan1730-Mar-10 19:47
skhan1730-Mar-10 19:47 
GeneralRe: Repositioning the cursor Pin
Som Shekhar30-Mar-10 20:01
Som Shekhar30-Mar-10 20:01 
GeneralRe: Repositioning the cursor Pin
Som Shekhar30-Mar-10 20:44
Som Shekhar30-Mar-10 20:44 
Questioncustom control properties Pin
xilefxilef30-Mar-10 10:13
xilefxilef30-Mar-10 10:13 
AnswerRe: custom control properties Pin
Paw Jershauge30-Mar-10 12:52
Paw Jershauge30-Mar-10 12:52 
GeneralRe: custom control properties Pin
xilefxilef30-Mar-10 13:18
xilefxilef30-Mar-10 13:18 
AnswerRe: custom control properties Pin
Paw Jershauge30-Mar-10 13:31
Paw Jershauge30-Mar-10 13:31 
GeneralRe: custom control properties Pin
yu-jian1-Apr-10 17:04
yu-jian1-Apr-10 17:04 
QuestionQuestion about the Type object Pin
Richard Blythe30-Mar-10 8:22
Richard Blythe30-Mar-10 8:22 
AnswerRe: Question about the Type object Pin
OriginalGriff30-Mar-10 8:29
mveOriginalGriff30-Mar-10 8:29 
GeneralRe: Question about the Type object Pin
PIEBALDconsult30-Mar-10 9:14
mvePIEBALDconsult30-Mar-10 9:14 
GeneralRe: Question about the Type object Pin
OriginalGriff30-Mar-10 9:22
mveOriginalGriff30-Mar-10 9:22 
GeneralRe: Question about the Type object Pin
PIEBALDconsult30-Mar-10 9:41
mvePIEBALDconsult30-Mar-10 9:41 
AnswerRe: Question about the Type object Pin
Luc Pattyn30-Mar-10 9:00
sitebuilderLuc Pattyn30-Mar-10 9:00 
GeneralRe: Question about the Type object Pin
PIEBALDconsult30-Mar-10 9:17
mvePIEBALDconsult30-Mar-10 9:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.