Skip to main content
Home Forums Silverlight Programming Programming with .NET - General How to get cursor coordinates from multiline text box and display listbox their
3 replies. Latest Post by vijchn on September 3, 2008.
(0)
vijchn
Member
24 points
37 Posts
09-02-2008 8:23 AM |
Hi,
I am working in silverlight 2 beta 2,
I make multiline text box and I want to display list box at
cursor postion,
So how I got the cursor position and how I display the list box at different positions
please give me suggesstion
Thanks
HarshBar...
Star
9908 points
1,719 Posts
09-02-2008 8:47 AM |
I think you want to get cursor position on mouse over of TextBox.(If i am wrong correct me).
You Can write a MouseEnter/MouseLeftButtonDown/MouseLeftButtonUp Handler for that and Can Get Mouse Position with Respect to that Object Example..(If you will Pass Object as Parameter to GetPositionn method you will get Relative Position)
{
string a =position.X.toString();
string b =position.Y.toString();
}
Web_Horse
5 points
55 Posts
09-02-2008 8:50 AM |
HarshBardhan:Hi, I think you want to get cursor position on mouse over of TextBox.(If i am wrong correct me). You Can write a MouseEnter/MouseLeftButtonDown/MouseLeftButtonUp Handler for that and Can Get Mouse Position with Respect to that Object Example..(If you will Pass Object as Parameter to GetPositionn method you will get Relative Position)void hlb_MouseEnter(object sender, MouseEventArgs e) { Point position = e.GetPosition(null); string a =position.X.toString(); string b =position.Y.toString(); }
Point position = e.GetPosition(null);
And call this method using MouseMove event.
Bye.
09-03-2008 3:01 AM |
Thanks for replay
The following code
void hlb_MouseEnter(object sender, MouseEventArgs e)
Gives me the mouse cursor position,
But I need the cursor position that blinks in text box
so please give me right suggestion