Results 1 to 6 of 6

Thread: arranging line or text in a listbox

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2005
    Posts
    150

    arranging line or text in a listbox

    I'm using the following command to add lines to a list box


    list1.additem 1 & "USER NAME" & "DEPARTMENT" & "THE DATE"

    Now I want the user name and the department name to appear justified, example:

    I don't want it to look like :



    1-FIRST NAME HERE DEPARTMENT HERE

    2-SECOND NAME HERE DEPARTMENT HERE

    3-THIRD NAME HERE DEPARTMENT HERE


    I want the line to look like


    1-FIRST NAME HERE ---------------DEPARTMENT HERE

    2-SECOND NAME HERE -------------DEPARTMENT HERE

    3-THIRD NAME HERE----------------DEPARTMENT HERE



    got my point? now can you help lol

  2. #2
    Fanatic Member paralinx's Avatar
    Join Date
    Jun 2005
    Location
    Michigan
    Posts
    987

    Re: arranging line or text in a listbox

    the vbTab command should provide this.
    VB Code:
    1. List1.additem 1 & "USER NAME" & vbTab & "DEPARTMENT" & vbTab "THE DATE"

  3. #3
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Re: arranging line or text in a listbox

    You might want to consider using a listview rather than a listbox. The listview will give you the data in columns and that allows for resizing of the columns and sorting if you wish.

  4. #4

    Thread Starter
    Addicted Member
    Join Date
    Aug 2005
    Posts
    150

    Re: arranging line or text in a listbox

    Thanks Paralinx
    Thanks MartinLiss I will look around about it

    Can you guys also tell me how do I break the line ? like pressing Enter using something like vbtap or so?

    Thanking you

  5. #5
    Frenzied Member
    Join Date
    May 2003
    Location
    Sydney
    Posts
    1,123

    Re: arranging line or text in a listbox

    vbcrlf - vb carriage return(goto next line) line feed(go to the beginning of the line)

  6. #6
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: arranging line or text in a listbox

    Quote Originally Posted by bomayed
    Can you guys also tell me how do I break the line ? like pressing Enter using something like vbtap or so?
    You can use:

    vbTab
    vbCrLf
    vbNewLine

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