| | |
help with alignment in list box
Please support our Visual Basic 4 / 5 / 6 advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved |
•
•
Join Date: Oct 2009
Posts: 3
Reputation:
Solved Threads: 0
Call List3.AddItem(txtname & vbTab & txtamount & vbTab & txtqan & _vbTab & Format$(ans, "Currency"))
need help need to align the text the keep displaying like this:
toy car 1 $3.00 $3.00
card board box1 $0.50 $0.50
remote control car 1 $3.00 $3.00
cart 1 1 $1.00 $1.00
this is just the sample need it to look clean need help please the out put must be:
toy car 1 $3.00 $3.00
card board box 1 $0.50 $0.50
remote control car 1 $3.00 $3.00
cart 1 $1.00 $1.00
need help need to align the text the keep displaying like this:
toy car 1 $3.00 $3.00
card board box1 $0.50 $0.50
remote control car 1 $3.00 $3.00
cart 1 1 $1.00 $1.00
this is just the sample need it to look clean need help please the out put must be:
toy car 1 $3.00 $3.00
card board box 1 $0.50 $0.50
remote control car 1 $3.00 $3.00
cart 1 $1.00 $1.00
•
•
Join Date: Oct 2008
Posts: 10
Reputation:
Solved Threads: 4
0
#2 Oct 27th, 2009
These two lists looks both the same. I guess this web didn't formated them well, so I don't now, what do you want to do with them exactly, but if you just want to make the lists aligned into nice columns, then try:
1) Right click on listbox and choose properties
2) Check gridlines (optionally, you'll see the cells then)
3) Set the view combo on value 3 - Report (thats necessary)
4) Set label edit on Manual (optionally, in the other case the first cell is editable by user as I remember)
5) Click on the "Column headers" tab and click four times on Insert column (necessary if you want to use my code below)
6) You can also name your columns, set their width, ...
then, for filling the list, use this:
This should work...
1) Right click on listbox and choose properties
2) Check gridlines (optionally, you'll see the cells then)
3) Set the view combo on value 3 - Report (thats necessary)
4) Set label edit on Manual (optionally, in the other case the first cell is editable by user as I remember)
5) Click on the "Column headers" tab and click four times on Insert column (necessary if you want to use my code below)
6) You can also name your columns, set their width, ...
then, for filling the list, use this:
Visual Basic 4 / 5 / 6 Syntax (Toggle Plain Text)
Dim itmLIST3 As ListItem Set itmLIST3 = List3.AddItem(txtName) itmLIST3.SubItems(1) = txtamount itmLIST3.SubItems(2) = txtqan itmLIST3.SubItems(3) = Format$(ans, "Currency")
This should work...
•
•
Join Date: Mar 2009
Posts: 851
Reputation:
Solved Threads: 156
1
#3 Oct 27th, 2009
Celt.Max,
the code you are using is for the VBA Listbox control found in Excel, access, etc. and while it is usable from VB6, it is not redistributable...
IvanKenny,
There are two ways in which to accomplish what you want...
1.) Use a listview control.
2.) Do a bit of subclassing on the listbox. See... http://www.thescarms.com/vbasic/listbox.aspx
Good Luck
the code you are using is for the VBA Listbox control found in Excel, access, etc. and while it is usable from VB6, it is not redistributable...
IvanKenny,
There are two ways in which to accomplish what you want...
1.) Use a listview control.
2.) Do a bit of subclassing on the listbox. See... http://www.thescarms.com/vbasic/listbox.aspx
Good Luck
If anyone has helped you solve your problem, please mark your thread as solved.
Thanks
Thanks
![]() |
Similar Threads
- Looking for List Box help, please! (VB.NET)
- getting data from a list box. (Visual Basic 4 / 5 / 6)
- [req]How to move elements in the list box up and down using command button? (Visual Basic 4 / 5 / 6)
- List Box as input field also (JavaScript / DHTML / AJAX)
- How do I populate multiple column list box? (Visual Basic 4 / 5 / 6)
- Drive List Box Help Please for Error 68 (Visual Basic 4 / 5 / 6)
- list box --php issue (PHP)
- My list box (Java)
- "Error in linking List box with the VB6.0 database" (Visual Basic 4 / 5 / 6)
Other Threads in the Visual Basic 4 / 5 / 6 Forum
- Previous Thread: Scanner :Scanning image of a Picture control to a Rich Text Box
- Next Thread: please help ? how calculate
| Thread Tools | Search this Thread |
* 6 429 2007 access activex add age append application basic beginner birth bmp calculator cd cells.find click client code college column component connection connectionproblemusingvb6usingoledb copy creat ctrl+f data database datareport date delete dissertations dissertationthesis dissertationtopic edit error excel excelmacro file filename form hardware header iamthwee image inboxinvb internetfiledownload keypress label listbox listview liveperson login looping machine microsoft movingranges number objectinsert open oracle password prime program prompt range-objects readfile reading record refresh remotesqlserverdatabase report retrieve save search sendbyte sites sort sql sql2008 sqlserver subroutine table tags textbox time urldownloadtofile vb vb6 vb6.0 vba visual visualbasic visualbasic6 web window windows





