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
Re: arranging line or text in a listbox
the vbTab command should provide this.
VB Code:
List1.additem 1 & "USER NAME" & vbTab & "DEPARTMENT" & vbTab "THE DATE"
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.
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
Re: arranging line or text in a listbox
vbcrlf - vb carriage return(goto next line) line feed(go to the beginning of the line)
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