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
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Alignment of More Than Two Text in Correct Format for CListBox.

Alignment of More Than Two Text in Correct Format for CListBox.

Scheduled Pinned Locked Moved C / C++ / MFC
3 Posts 3 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.
  • J Offline
    J Offline
    janaswamy uday
    wrote on last edited by
    #1

    Hi all, i have to Append the String Values in CListBox just Like ClistCtrl Does. I mean i am appending the String values inside the ClistBox with some Gaps but they are not Alligned Properly. I have to Display just like CListControl. Code: ----- CListBox.AddString("one"+ "-----------------" +"1"); //Equal Space Padding automatically depending on Chars in List. CListBox.AddString("Twently"+ "-------------" +"2"); The Padding of Small and Big charters in CListBox must just appear as CListCtrl. Give a solution for this. Thanks, Uday.

    L K 2 Replies Last reply
    0
    • J janaswamy uday

      Hi all, i have to Append the String Values in CListBox just Like ClistCtrl Does. I mean i am appending the String values inside the ClistBox with some Gaps but they are not Alligned Properly. I have to Display just like CListControl. Code: ----- CListBox.AddString("one"+ "-----------------" +"1"); //Equal Space Padding automatically depending on Chars in List. CListBox.AddString("Twently"+ "-------------" +"2"); The Padding of Small and Big charters in CListBox must just appear as CListCtrl. Give a solution for this. Thanks, Uday.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      I am not sure I understand your question but I suspect that your CListBox is using a proportional font so individual characters are only as wide as they need to be. You probably want to use a fixed width font, such as Courier, where each character is the same width in pixels.

      Just say 'NO' to evaluated arguments for diadic functions! Ash

      1 Reply Last reply
      0
      • J janaswamy uday

        Hi all, i have to Append the String Values in CListBox just Like ClistCtrl Does. I mean i am appending the String values inside the ClistBox with some Gaps but they are not Alligned Properly. I have to Display just like CListControl. Code: ----- CListBox.AddString("one"+ "-----------------" +"1"); //Equal Space Padding automatically depending on Chars in List. CListBox.AddString("Twently"+ "-------------" +"2"); The Padding of Small and Big charters in CListBox must just appear as CListCtrl. Give a solution for this. Thanks, Uday.

        K Offline
        K Offline
        krmed
        wrote on last edited by
        #3

        You might take a look at SetTabStops[^] in MSDN. Using that, you can still use proportional fonts. Hope that helps.

        Karl - WK5M PP-ASEL-IA (N43CS) PGP Key: 0xDB02E193 PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193

        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