Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# WinForm
I have a problem, i have text stored in xml file formatting like this:
    <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 27-Jun-12 0:21am
Edited 27-Jun-12 4:47am
v3
Comments
Shahin Khorshidnia at 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 at 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ő at 27-Jun-12 7:05am
   
I suppose you need something special. With asp.net it looks a little bit easier...
Sergey Alexandrovich Kryukov at 27-Jun-12 13:17pm
   
What is easier... it really depends.
--SA
Zoltán Zörgő at 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 :)
Sergey Alexandrovich Kryukov at 29-Jun-12 18:47pm
   
When I said "it depends" I did not mean DOM; I referred to your "with ASP.NET" it looks a little bit easier. ASP.NET does not generally make anything easier (for example, when it comes to applications, it's actually usually much harder then desktops, because Web applications has to overcome draconian limitations of HTTP), but nevertheless I know some aspects or cases easier with Web applications, especially ASP.NET -- that's why I said "it depends".
--SA

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

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
  Permalink  

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



Advertise | Privacy | Mobile
Web03 | 2.8.141002.1 | Last Updated 27 Jun 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100