Skip to main content

Microsoft Silverlight

Unanswered Question How to get cursor coordinates from multiline text box and display listbox theirRSS Feed

(0)

vijchn
vijchn

Member

Member

24 points

37 Posts

How to get cursor coordinates from multiline text box and display listbox their

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

 

 

 

 

 

 

HarshBardhan
HarshBar...

Star

Star

9908 points

1,719 Posts

Re: How to get cursor coordinates from multiline text box and display listbox their

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();



 

}

Mark as answer if this post answered your question.

Harsh Bardhan

Web_Horse
Web_Horse

Member

Member

5 points

55 Posts

Re: How to get cursor coordinates from multiline text box and display listbox their

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();



 

}

 

 

And call this method using MouseMove event.

 

Bye.

vijchn
vijchn

Member

Member

24 points

37 Posts

Re: How to get cursor coordinates from multiline text box and display listbox their

 Hi,

Thanks for replay

The following code

void hlb_MouseEnter(object sender, MouseEventArgs e)

{

 Point position = e.GetPosition(null);

  string a =position.X.toString();

string b =position.Y.toString();

 }

Gives me the mouse cursor position,

But I need the cursor position that blinks in text box

so please give me right suggestion

Thanks

 

 

 

  • Unanswered Question
  • Answered Question
  • Announcement
Microsoft Communities