Results 1 to 2 of 2

Thread: listbox - AGAIN

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105
    Try different fonts. If the font isn't mono-spaced (same area used by every character), you'll never get it to line up...

  2. #2
    Hyperactive Member
    Join Date
    May 1999
    Location
    Reynosa, Mexico
    Posts
    274
    But, you can insert Tabs (columns) into your listbox. Use this code:

    Code:
    'This code in Declarations section of the form
    private Tabs(2) As Long
    private Const LB_SETTABSTOPS As Long = &H192
    Declare Function SendMessage Lib "user32" _
       Alias "SendMessageA" _
      (ByVal hwnd As Long, _
       ByVal wMsg As Long, _
       ByVal wParam As Long, _
       lparam As Any) As Long
    
    'This is the function that insert Tabs in your ListBox
    Public Sub DoTabs(lstListBox As ListBox, TabArray() As Long)
    
    'limipia cualquier Tab existente
    Call SendMessage(lstListBox.hwnd, LB_SETTABSTOPS, 0&, ByVal 0&)
    'Ajusta Tabs
    Call SendMessage(lstListBox.hwnd, LB_SETTABSTOPS, CLng(UBound(TabArray)), TabArray(0))
    
    End Sub
    
    'This code in you rForm_Load
    Tabs(0) = 0
    Tabs(1) = 70
    Tabs(2) = 100
    DoTabs list1, Tabs
    
    List1.AddItem String1 & vbTab & String2
    List1.AddItem String1 & vbTab & String2
    List1.AddItem String1 & vbTab & String2
    List1.AddItem String1 & vbTab & String2
    Ulises Vázquez
    [size=1.7]Oracle DBA Certified Professioanl
    Visual Basic 6 Developer
    Crystal Reports Designer
    [/size]

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