Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2004

    Unanswered: Formatting ListBox

    I am having difficulties with formatting listbox. I have 3 coulumns and 4 rows. such as

    Name Phonenumber Married
    Tim 123-4569 Y
    Jack 546-8965 N
    Phil 596-8745 Y

    So now I would like to display these two colums so that 1st row the header is going to be bold and underlined.

    For rest of the rows, 1st coulmns will be right justified, 2nd column will be Left justified and 3rd column will be center justified.

    I am using VB.NET and doing windows application. I tried the following code:

    dim fmt as stirng

    fmt = {0,10}{1,20}{2,30}
    lstbox.items.add(string.format(fmt,"Name","Phone", "Married"))

    But I am not getting the right allignement.

    Can you suggest me any online tutorial about ListBox formatting or solve the problem.

  2. #2
    Join Date
    Oct 2004
    In cousin's house
    Try this my friend . I create my own function name Space'

    Function Space(First, Second As Integer) As String
    Space = ""
    While First <= Second
    Space = Space + " "
    First = First + 1
    End Function

    listbox1 = String+ Space(Len(String), 10)

    First = 1234567890 232323
    Second = 1234 232323

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts