Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. CLISTBOX Owner Drawn ListBox , DrawText does not return correct height.

CLISTBOX Owner Drawn ListBox , DrawText does not return correct height.

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorial
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Killer3
    wrote on last edited by
    #1

    CODE SNIPNET m_nFormat= DT_NOPREFIX | DT_LEFT | DT_WORDBREAK | DT_EXPANDTABS | DT_EDITCONTROL; CClientDC dc(pWnd); UINT nFormat = m_nFormat | DT_CALCRECT; dc.DrawText(strText, cellRect, nFormat); int nTotalPadding = (2 * m_nTextPadding); lpItemStruct->itemWidth = cellRect.Width() + nTotalPadding; lpItemStruct->itemHeight = cellRect.Height() + nTotalPadding; The height returned by the CDC::DrawText is not consitent, it behaves different for string of same length example.. 1) String full capital letters of length say 160 it returns ==> 81 2) String full capital letters of length say 160 it returns ==> 81 3) String full small letters of length say 160 it returns ==> 100 Please help on this

    for thendral

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups