views:

34

answers:

1

In other words, if I have:

var ll = new LinkLabel();
ll.Text = "Some links go here.";
ll.Links.Add(0, 4);  // Some
ll.Links.Add(11, 2);  // go

Is there any method I can call to replace the text of the "Some" link with something else while keeping the "go" link the same.

I only want to know if there is a built-in method. This is not hard to code, I just don't want to reinvent the wheel.

I have, of course, consulted the LinkLabel documentation but sometimes methods hide in unexpected places.

+1  A: 

Not that I know of — you would have to change both the text and modify the link so that it corresponds to the correct substring of the updated text.

A simpler solution may be to have a FlowLayoutPanel containing separate controls: a LinkLabel with text 'Some', a Label with text 'links', a LinkLabel with text 'go' and a Label with text 'here.'. That way, you would end up with a similar looking UI but would be able to adjust the individual items without having to jump through hoops.

Paul Ruane