Questions tagged [mouse-position]

197 questions
11
votes
3 answers

How to get specific text value from a textbox based upon the mouse position

I have a multi-line text box that displays some values based on data it gets given, (Generally one value per line). (For the purpose of having a tool tip popup with some 'alternative' data) I would like to get the word (or at the very least the…
Jammerz858
  • 1,605
  • 3
  • 14
  • 14
9
votes
2 answers

WPF - how do I bind a control's position to the current mouse position?

Is there a way to bind to the mouse position in WPF in the XAML file? Or does that have to be done in code? I have a control inside a Canvas, and I just want the control to follow the mouse while the mouse cursor is inside the…
pkr
  • 1,723
  • 5
  • 25
  • 43
8
votes
5 answers

Getting Position of mouse cursor when clicked out side the form's boundary

It is very easy to get the position of cursor out side the form's boundary by just dragaging the mouse it sends many values to the form when ever the position changes, form the following line of code. MessageBox.Show(Cursor.Position.ToString()); …
Farid-ur-Rahman
  • 1,809
  • 9
  • 31
  • 47
8
votes
2 answers

C# how to show a form at a specific mouse position on the screen?

I have two Forms, my main form is Form1 and my secondary form shown on demand as a dialog is Form2. Now if I call Form2 it shows always up in the upper left corner on my screen. First time I thought my form isn't there at all, but then I saw it…
feedwall
  • 1,473
  • 7
  • 28
  • 48
7
votes
2 answers

Finding Mouse Position relative to a panel

I'm trying to get the mouse's position within a panel, as in the top left of the panel = x/y 0,0. What I have at the minute gives the position on the entire screen, so depending on where the panel (which is in a frame) is on the screen, the…
DMCH
  • 105
  • 1
  • 1
  • 4
6
votes
1 answer

HTML5 Canvas Scrolling Messes with Mouse Position

I am messing around with HTML5 right now and I wanted to program a little browser games - just for fun. I created a canvas in which a background image is loaded - its kind of a hexagonal grid. To find out which hexagon is clicked I use circles an…
Daniel
  • 127
  • 2
  • 8
5
votes
2 answers

How do I get mouse position relative to the parent widget in tkinter?

I need to get the mouse position relative to the tkinter window.
rectangletangle
  • 50,393
  • 94
  • 205
  • 275
5
votes
2 answers

Determining if a mouse position is near the edges of the browser

In a browser, I'm trying to determine if the point representing the mouse position is in what I call an "outer area" . For example, in the image attached, the outer area is the one with a blue background. In the code and image W represents the…
ivb
  • 167
  • 1
  • 13
5
votes
2 answers

How to get the control under the mouse cursor in onMouseDown event?

I have a TGridLayout filled with some images in a Firemonkey HD Application. In the gridLayout's onMouseDown event I want to get the image object on which the user has clicked, but I have only mouse coordinates. Implementing onMouseDown event for…
iPath ツ
  • 2,468
  • 20
  • 31
5
votes
2 answers

How to convert from a mouse position to a character position in a JEditorPane in Java Swing

I'm currently trying to solve a problem where I need to find the position in a piece of text in a JEditorPane based on where the mouse was clicked. Basically, when the user right-clicks over a word I need to find out what the word is. To do this I…
Scottm
  • 7,004
  • 8
  • 32
  • 33
4
votes
2 answers

What is the best way to get mouse position over form?

I want the best way to get mouse position for Form. I,m now set the values of mouse position in variables to get them in another methods "Like Form1_Click". Is there any better way to do that??. Thank you very much.
Wahid Bitar
  • 13,776
  • 13
  • 78
  • 106
4
votes
3 answers

Move an image according to the mouse cordinates using jquery

I am trying to develop a HTML5 white board. I want the users viewing the board to know where exactly the presenter is pointing within the screen. I am able to collect the mouse movements using this jquery function. But even if i succeed to pass…
esafwan
  • 17,311
  • 33
  • 107
  • 166
4
votes
2 answers

Get Mouse Position when pressing a character

I want to get the position of my mouse relative to the frame when I click a shortcut: @Override public void handle(KeyEvent keyEvent) { if (keyEvent.isShortcutDown()) { if (keyEvent.getCode() == KeyCode.P) { //Code Here …
JBaoz
  • 180
  • 10
4
votes
3 answers

How to prevent mouseMoveEvent on QCursor::setPos() using Qt?

I am currently developing on an image viewer application. In this application I have a so called "pan-zoom" feature. This means that, when holding a certain mouse button, the user can zoom the image by panning forth and back. It works fine, but as…
bweber
  • 3,772
  • 3
  • 32
  • 57
4
votes
2 answers

Making eyeball look at/follow cursor movement (C#)

I'm stuck here. I want to have the eyes drawn while 'looking' at (the angle of) the cursor. Also, it should be contained within the bigger circle/quadrant (just like an eyeball). Sadly, it just won't draw the eye for me at the right position/angle…
carrotcake
  • 97
  • 1
  • 5
1
2
3
13 14