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. Addstring in ListBox

Addstring in ListBox

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

    Hi all, Wanted to know if it is possible to both pad a hex numbers with leading 0's and also format the width of the message. I have a string and i just concat a hex number to it. I just want to space out the numbers so that they will line up with the next string added, so that it has the look of a table. Right now i am padding the hex number like this:

    testStr.Format("%03X" , myString);
    Str += testStr;
    testStr.Format("%03X" , myString2);
    Str += testStr;
    Listbox.AddString(Str);
    

    I know if i take away the 0, then it will set the width, but i need to do both. CAN THIS BE DONE? thanks in advance. Jimmy Just cause I am 15, doesn't mean I'm dumb! (I'll really be 4 on Feb. 29...the year 2004)

    J 1 Reply Last reply
    0
    • N NewHSKid

      Hi all, Wanted to know if it is possible to both pad a hex numbers with leading 0's and also format the width of the message. I have a string and i just concat a hex number to it. I just want to space out the numbers so that they will line up with the next string added, so that it has the look of a table. Right now i am padding the hex number like this:

      testStr.Format("%03X" , myString);
      Str += testStr;
      testStr.Format("%03X" , myString2);
      Str += testStr;
      Listbox.AddString(Str);
      

      I know if i take away the 0, then it will set the width, but i need to do both. CAN THIS BE DONE? thanks in advance. Jimmy Just cause I am 15, doesn't mean I'm dumb! (I'll really be 4 on Feb. 29...the year 2004)

      J Offline
      J Offline
      JWood
      wrote on last edited by
      #2

      Is myString a number? J. ----------------------------

      N 1 Reply Last reply
      0
      • J JWood

        Is myString a number? J. ----------------------------

        N Offline
        N Offline
        NewHSKid
        wrote on last edited by
        #3

        oops...sorry about that yes, both myString and myString2 are numbers that needs to be displayed as hex Jimmy Just cause I am 15, doesn't mean I'm dumb! (I'll really be 4 on Feb. 29...the year 2004)

        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