Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Link Edit Position (Read 1708 times)
rajesh_patil74
Full Member
***
Offline


I love YaBB 1G - SP1!

Posts: 220
Joined: Sep 3rd, 2009
Link Edit Position
Apr 12th, 2010 at 9:53am
Print Post  
Hi Stoyo

When Keyboard "F2" key I want to provide edit functionality for links.

How one can get the text box on the position where actual text is displayed for the link. Right now calling "BeginEdit" for link display textbox at random position.

-Rajesh
  
Back to top
WWW  
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Link Edit Position
Reply #1 - Apr 13th, 2010 at 7:55am
Print Post  
Hi Rajesh,

Try this -

Code
Select All
var r = link.GetBounds();
var p = new Point(r.X, r.Y);

var lc = (link.Content as Canvas);
if (lc != null)
{
	foreach (UIElement ui in lc.Children)
	{
		var tb = ui as TextBlock;
		if (tb != null)
		{
			p.X += tb.Margin.Left;
			p.Y += tb.Margin.Top;
		}
	}
}

diagram.BeginEdit(link, p); 



I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint