Click here to Skip to main content
15,890,527 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi
I am trying to give a link for specific word in a linklabel.
eg:

Linklabel linkLabel1=new Linklabel();
        linkLabel1.Text = "Hi this is an asp.net window application";
        LinkArea obj=new LinkArea(0,14);
        linkLabel1.LinkArea = obj;
        linkLabel1.LinkColor = Color.DarkRed;
        linkLabel1.LinkVisited = false;


Here i want to give a link for asp.net word.If i want to give that link for asp.net,
in linkarea i want to define the location ,ie start index of asp.net word.For that,
How to find the specific word location from the label.
Posted
Updated 5-Aug-12 21:53pm
v3
Comments
OriginalGriff 6-Aug-12 2:59am    
This is not a good question - we cannot work out from that little what you are trying to do.
Remember that we can't see your screen, access your HDD, or read your mind.
Use the "Improve question" widget to edit your question and provide better information.
AshishChaudha 6-Aug-12 3:29am    
What you have tried so far...Clear your question, cant understand your problem..

1 solution

XML
Hello

Here is the Solution of your Problem

///*********************Try this
int ind = linkLabel1.Text.IndexOf("asp.net");
int l = "asp.net".Length;
linkLabel1.Links.Add(ind, l);
/////////////**********
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900