|
|
|
You can easily create columns of data in a ListBox control by setting its tab stop at appropriate positions. This way, you can use a ListBox control as a sort of grid control with (very) limited functionality, but without using third-party controls.
You can set ListBox's tab stop by sending the control a LB_SETTABSTOPS message, where wParam contains the number of desired tab stops, and lParam points to the first element of an array of Long values that contains the new tab stop positions. The following reusable routine does the trick |
Note that the values in the array are expressed in dialog units, where the average character's width corresponds to 4 dialog units. The following code example set the tab stop position at (approximately) the 10th, 18th and 25th character: |
ListBoxSetTabStops List1, tabs()
Once you have set the tab stops appropriately, you just add new items to the ListBox, where the values in each column should be separated by vbTab characters: |
|
|
|
Submitted By :
Nayan Patel
(Member Since : 5/26/2004 12:23:06 PM)
|
|
|
Job Description :
He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting. |
View all (893) submissions by this author
(Birth Date : 7/14/1981 ) |
|
|