locked
Make a TextBox follow the mouse pointer RRS feed

  • Question

  •  I want to display a readonly TextBox that is always, say, 10 pixels above the mouse pointer.  How do I do this?

     I assume I'll need to handle the MouseMove event and get the current mouse position in the handler.  Then what?

    Monday, June 28, 2010 10:52 PM

Answers

  • Never mind, got it working. 

    First I set HorizontalAlignment = Left and VerticalAlignment = Top.  Then, in the MouseMove handler, I set Margin.Left and Margin.Top based on the mouse position.

    Monday, June 28, 2010 11:12 PM