CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Using DrawText

  1. #1
    Join Date
    May 1999
    Location
    FRANCE, Toulouse
    Posts
    39

    Using DrawText

    Hi !
    I want to display several items in a CView in a vertical mode.
    I create the CFont with a LOGFONT (using Arial font and a lfEscapement set to 900 = 90°).
    My problem is how to display all the item using DrawText. How to calculate ce CRect for displaying each item ?





  2. #2
    Join Date
    Apr 1999
    Posts
    383

    Re: Using DrawText

    If you use the DT_CALCRECT format, DrawText will size the rectangle you pass in to fit the text, but it won't draw the text. See the online help for DrawText.

    Dave


  3. #3
    Join Date
    May 1999
    Location
    West Sussex, England
    Posts
    1,939

    Re: Using DrawText

    When you select the font into a DC, the GetTextExtent() function will still return meaningful results. Its just that the .x will be the height of the font, while the .y value will be the length of the text in that font.

    HTH


    Roger Allen
    Please use meaningful question titles - "Help me" does not let me know whether I can help with your question, and I am unlikely to bother reading it.
    Please remember to rate useful answers. It lets us know when a question has been answered.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured