Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
capturing mouse events?
Collapse
X
-
Hi chuckt101, you can easily capture mouse x/y coordinates by adding an event handler to your indicators underlying control.
Add something like this to your OnStartUp():
And add the method in your indicatorCode:ChartControl.MouseMove += mouseMoveHandler;
X and Y are just examples, you can do things with clicks, mouse-wheel, etc. Hope this helpsCode:private void mouseMoveHandler(object sender, MouseEventArgs e) { // do whatever with mouse coords contained in e here Print(String.Format("mouseMoveHandler X = {0} Y = {1}!", e.X, e.Y)) }
edit: if you simply want to capture clicks, you'll want to use the MouseDown event versus MouseMove. You can find a breakdown of mouse events on MSDN here http://msdn.microsoft.com/en-us/libr...mousedown.aspxLast edited by Dexter; 02-28-2011, 04:47 PM.
Comment
-
-
Thank you johne5. That revealed my mistake....needed MouseDown on the ChartPanel...makes sense (now!).
Comment
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by Geovanny Suaza, 02-11-2026, 06:32 PM
|
0 responses
596 views
0 likes
|
Last Post
|
||
|
Started by Geovanny Suaza, 02-11-2026, 05:51 PM
|
0 responses
343 views
1 like
|
Last Post
|
||
|
Started by Mindset, 02-09-2026, 11:44 AM
|
0 responses
103 views
0 likes
|
Last Post
by Mindset
02-09-2026, 11:44 AM
|
||
|
Started by Geovanny Suaza, 02-02-2026, 12:30 PM
|
0 responses
556 views
1 like
|
Last Post
|
||
|
Started by RFrosty, 01-28-2026, 06:49 PM
|
0 responses
554 views
1 like
|
Last Post
by RFrosty
01-28-2026, 06:49 PM
|

Comment