Help Needded How I Create Listbox That Look Like Multi Column Listbox 
Author Message
 Help Needded How I Create Listbox That Look Like Multi Column Listbox

I want to create Listbox that will show like the next format

Code       Name        Location
100         Name1      Box1
102         Name2      Box1
103         Name3      Box1
104         Name4      Box1
105         Name5      Box1

my problem is that the strings are not the same size so it look messy
in C we solve this problem by useing Tabstops
C code
   BaseUnit = (int)GetDialogBaseUnits();
   nTabStops=2;
   vTabStops[0]=BaseUnit*3;
   vTabStops[1]=vTabStops[0]+BaseUnit*3;
   SendDlgItemMessage(hDlg,LB_TESTS,LB_SETTABSTOPS,(WORD)nTabStops,(      
                              DWORD)(LPSTR)vTabStops);

I dont know how to create the same thing in vb
Any help will be greatly appreciate.

--
Avner Belisha



Thu, 13 Jan 2000 03:00:00 GMT  
 Help Needded How I Create Listbox That Look Like Multi Column Listbox


Fri, 19 Jun 1992 00:00:00 GMT  
 Help Needded How I Create Listbox That Look Like Multi Column Listbox

Public Declare Function SendMessageArray Lib "user32" Alias "SendMessageA"
_
????(ByVal hwnd As Long, _
?????ByVal wMsg As Long, _
?????ByVal wParam As Long, _
?????lParam As Any) As Long

Public Const LB_SETTABSTOPS = &H192

Sub Form_Load()

    Dim r As Long

   'set up the tabstops in the listboxes
    ReDim tabstop(1 To 3) As Long

   'assign some values to the tabs for the second, third and fourth
   'column (the first is flush against the listbox edge)
    tabstop(1) = 90
    tabstop(2) = 130
    tabstop(3) = 185

   'set the tabs
    r = SendMessageArray(List1.hwnd, LB_SETTABSTOPS, 3, tabstop(1))
    List1.Refresh

End Sub

--
Randy Birch, MVP Visual Basic

Moderator, Fidonet Visual Basic Programmer's Conference
VBnet, The Visual Basic Developers Resource Centre
http://home.sprynet.com/sprynet/rasanen/



: I want to create Listbox that will show like the next format
:
: Code       Name        Location
: 100         Name1      Box1
: 102         Name2      Box1
: 103         Name3      Box1
: 104         Name4      Box1
: 105         Name5      Box1
:
: my problem is that the strings are not the same size so it look messy
: in C we solve this problem by useing Tabstops
: C code
:    BaseUnit = (int)GetDialogBaseUnits();
:    nTabStops=2;
:    vTabStops[0]=BaseUnit*3;
:    vTabStops[1]=vTabStops[0]+BaseUnit*3;
:    SendDlgItemMessage(hDlg,LB_TESTS,LB_SETTABSTOPS,(WORD)nTabStops,(    

:                               DWORD)(LPSTR)vTabStops);
:
: I dont know how to create the same thing in vb
: Any help will be greatly appreciate.
:
: --
: Avner Belisha

:



Thu, 13 Jan 2000 03:00:00 GMT  
 Help Needded How I Create Listbox That Look Like Multi Column Listbox


Fri, 19 Jun 1992 00:00:00 GMT  
 Help Needded How I Create Listbox That Look Like Multi Column Listbox

This is a multi-part message in MIME format.

------=_NextPart_000_01BC9B75.D5AD13E0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit

Why not use a ListView control and set the view property to report.

This performs like the standard listbox but with resizable columns and
column headers, and much more functionality.

Lee.
------=_NextPart_000_01BC9B75.D5AD13E0
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

<html><head></head><BODY bgcolor=3D"#FFFFFF"><p><font size=3D2 =
color=3D"#000000" face=3D"Arial">Why not use a ListView control and set =
the view property to <font color=3D"#FF0000">report<font =
color=3D"#000000">.<br><br>This performs like the standard listbox but =
with resizable columns and column headers, and much more =
functionality.<br><br>Lee.</p>
</font></font></font></body></html>
------=_NextPart_000_01BC9B75.D5AD13E0--



Fri, 14 Jan 2000 03:00:00 GMT  
 Help Needded How I Create Listbox That Look Like Multi Column Listbox

If you write a routine to pad the text string and format
the string, you can create a line that is a specific length
everytime.  This example will display the title up to 25
characters, add 5 spaces, then display the name up to
10 characters.  Good luck.
(Type pad being L = left, C = center, R = right - right being
the default)

Example:

'PadText(TextString As String, NumbChars As Integer, PadChar As
String, TypePad As String)

Name = PadText(Name, 10, "", "")
Title = Left(TestRecSet("title"), 25)
Title = PadText(Title, 26, "", "")
lstTestlist.AddItem Title + "    " + Name



Fri, 14 Jan 2000 03:00:00 GMT  
 Help Needded How I Create Listbox That Look Like Multi Column Listbox

->I want to create Listbox that will show like the next format
->
->Code       Name        Location
->100         Name1      Box1
->102         Name2      Box1
->103         Name3      Box1
->104         Name4      Box1
->105         Name5      Box1
->
->my problem is that the strings are not the same size so it look
messy
->in C we solve this problem by useing Tabstops
->C code
->   BaseUnit = (int)GetDialogBaseUnits();
->   nTabStops=2;
->   vTabStops[0]=BaseUnit*3;
->   vTabStops[1]=vTabStops[0]+BaseUnit*3;
->   SendDlgItemMessage(hDlg,LB_TESTS,LB_SETTABSTOPS,(WORD)nTabStops,(

->                              DWORD)(LPSTR)vTabStops);
->
->I dont know how to create the same thing in vb
->Any help will be greatly appreciate.

Unless this is a 16-bit application, you may want to use the ListView
control instead.

Paul
~~~~



Fri, 14 Jan 2000 03:00:00 GMT  
 Help Needded How I Create Listbox That Look Like Multi Column Listbox

The problem I ran into with a solution like that is the fonts
are not proportional, so your padding doesn't end up looking
correct.
--
---------------------------------------------------------------

www.dunnsys.com
VBScript Help: www.concentric.net/~neurowiz



Quote:
> If you write a routine to pad the text string and format
> the string, you can create a line that is a specific length



Fri, 14 Jan 2000 03:00:00 GMT  
 Help Needded How I Create Listbox That Look Like Multi Column Listbox

I'd say use the list view also.......but with one addition.  The list view
will not highlight an entire row without an API call to SendMessageLong, so
add this call and it will be the perfect control.  If you need an example
of this API call, email me.

David Knight



Why not use a ListView control and set the view property to report.

This performs like the standard listbox but with resizable columns and
column headers, and much more functionality.

Lee.
----------



Sat, 15 Jan 2000 03:00:00 GMT  
 
 [ 9 post ] 

 Relevant Pages 

1. Help Needed How I Create Listbox That Look Like Multi Column Listbox

2. Help Needed How I Create Listbox That Look Like Multi Column Listbox

3. View One column of Multi Column Listbox

4. Checkbox in multi-column listbox or grid column?

5. Multi-column listbox w/3 columns of checkboxes

6. Multi-column listbox w/3 columns of checkboxes

7. Multi-column ListBox Help Please?

8. Multi Column ListBox Help

9. Help/suggestion for 3rd party grid or multi-column listbox

10. HELP:multi column listbox

11. Multi-column Listbox

12. Filling multi-column Listbox with Callback function

 

 
Powered by phpBB® Forum Software