Click here to Skip to main content
15,884,425 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:

I have a problem, i have text stored in xml file formatting like this:
XML
<sentence>
    <token tag='man'>
        John
    </token>
    <token>
        is
    </token>
    <token>
        a doctor
    </token>
</sentence>
<sentence>
    <token tag='man'>
        He
    </token>
    <token>
        has
    </token>
    <token>
        a wife
    </token>
</sentence>
....


I want to show this text for User(on a TextBox, a Panel,...) ,and tokens which have tag='man'(in this case:John,He) have different color from the rest, plus, they can be Clicked (to show extra information,etc). It appears that in ToolBox there is not such a tool could do this. So I don't know how to solve it, does anybody have any suggestions?
Thanks for reading this!
Posted
Updated 27-Jun-12 4:47am
v3
Comments
Shahin Khorshidnia 27-Jun-12 6:59am    
1. Please Tag your question WinForm? ASP.Net? WPF? ...
2. Seach the google. You need a Highlighter (I think)
rongvangso7 27-Jun-12 10:54am    
thank Shahin, but with my problem I can't find a search term appropriately... :( do you have any advices??
Zoltán Zörgő 27-Jun-12 7:05am    
I suppose you need something special. With asp.net it looks a little bit easier...
Sergey Alexandrovich Kryukov 27-Jun-12 13:17pm    
What is easier... it really depends.
--SA
Zoltán Zörgő 27-Jun-12 14:27pm    
Sure, but DOM helps a lot in manipulating the UI; it is easier to combine controls as layout elements or change their look and feel as in windows forms. Of course, it has its own limitations... it really depends :)

1 solution

You will need to develop you own control, for example, on the base of System.Windows.Forms.RichTextBox, please see:
http://msdn.microsoft.com/en-us/library/system.windows.forms.richtextbox.aspx[^].

—SA
 
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