-1

I need to know how to get caret position when I press a key (TAB). My application need the “Tab” XY position when any user press the tab key on the any UI.

Is there any way to catch the “Tab” position?

Thanks,

mahen
  • 165
  • 3
  • 16
  • 2
    Did you try Cursor.Position property for this? https://msdn.microsoft.com/en-us/library/system.windows.forms.cursor.position(v=vs.110).aspx – Joe 89 Sep 25 '15 at 05:17
  • Yes ,I try but it gives the Mouse position when mouse changed.But in my case the keybord tab is pressed and need the cursor position. – mahen Sep 28 '15 at 08:54

1 Answers1

0

You can get cursor position for the last message retrieved by the GetMessage function by calling GetMessagePos() function

Vlad Feinstein
  • 10,960
  • 1
  • 12
  • 27
  • I need the CaretPosition because my mouse pointer position is at difference place. – mahen Oct 27 '15 at 09:55
  • @mahen - Would you please edit your question? It still reads "how to get mouse position". For caret position, see this: http://stackoverflow.com/questions/526540/how-do-i-find-the-position-of-a-cursor-in-a-text-box-c-sharp – Vlad Feinstein Oct 27 '15 at 13:47