Space saving with formatted text?

Discussion in 'Questions (Windows Mobile)' started by mwaite, May 26, 2007.

  1. mwaite

    mwaite Member Licensed User

    Hello,

    I'm looking for some screen space-saving suggestions on the best way to present several paragraphs of formatted text. I'd like to present several paragraphs with a combination of bold, italics, and optionally color and/or font sizes.

    Best I can figure is this would have to be accomplished with multiple labels with FormLib, however the tricky part then becomes sizing and positioning the labels to the exact text width, and to also take into account word-wrap.

    Clever suggestions (or even not-so-clever ones:D) would be greatly appreciated.
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    The ImageLib library includes two methods to get the exact width and height of text - StringWidth / StringHeight.
    It uses the font of the form.
    You should set the form's font to the same style as the label you want and then use these methods.
     
  3. RandomCoder

    RandomCoder Well-Known Member Licensed User

    Why not just write directly on the form using DrawString, the colour and font style can be modified as you go :).
    Not so sure that you can make text bold though :(

    Regards,
    RandomCoder
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    Changing the form's font style (using FormLib) will change the style of DrawString (it will not change already drawn strings).
     
  5. RandomCoder

    RandomCoder Well-Known Member Licensed User

    I kind of thought that was what he was after. You could draw attention to different paragraphs/sections of text by using a different font etc.

    Regards,
    RandomCoder
     
  6. mwaite

    mwaite Member Licensed User

    Thank you gentlemen! This is exactly what I was looking for :)

    I missed the StringWidth/StringHeight methods :signOops:
     
Loading...