Winforms formatting text issues

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • =?Utf-8?B?RXRoYW4gU3RyYXVzcw==?=

    Winforms formatting text issues

    Hi,
    I have a Winforms app (in C#.Net 2.) which has to display some relatively
    long lists of information. Right now, I am just putting on the info on a
    multiline label, one item per line. I would like to be able to do things like
    adjust line spacing, make certain items bold and so forth. Is there an easy
    way to do that?
    I know I can use a Rich Text Box and I am also thinking about making each
    item it's own label and adjusting it location programatically , but before I
    start on either of those, I want to know if I am missing something...

    Thanks!
    Ethan
  • Alberto Poblacion

    #2
    Re: Winforms formatting text issues

    "Ethan Strauss" <EthanStrauss@d iscussions.micr osoft.comwrote in message
    news:7456E24B-0CEB-4C6B-9C07-1FA54DB705B6@mi crosoft.com...
    I have a Winforms app (in C#.Net 2.) which has to display some
    relatively
    long lists of information. Right now, I am just putting on the info on a
    multiline label, one item per line. I would like to be able to do things
    like
    adjust line spacing, make certain items bold and so forth. Is there an
    easy
    way to do that?
    I know I can use a Rich Text Box and I am also thinking about making
    each
    item it's own label and adjusting it location programatically , but before
    I
    start on either of those, I want to know if I am missing something...
    There's another possibility that you may consider:
    In the form's Paint event, grab the e.Graphics parameter, and then
    execute a series of e.Graphics.Draw string(...) calls to paint all the lines
    that you need to display. This gives you complete control on the spacing and
    formatting of your info, just by playing with the parameters of DrawString.


    Comment

    Working...