Results 1 to 3 of 3

Thread: [RESOLVED] Listbox

  1. #1

    Thread Starter
    PowerPoster Pasvorto's Avatar
    Join Date
    Oct 2002
    Location
    Minnesota, USA
    Posts
    2,951

    Resolved [RESOLVED] Listbox

    I have the file uploaded to the scanner. Now I need to display it. I created a second form. I put a listbox control on it. The VB2005 manual refers to propertiy of 'multiColumn'. I don't see that property available to me. Is it something I can do programatically? I need to display 6 columns of data.
    ===================================================
    If your question has been answered, mark the thread as [RESOLVED]

  2. #2
    Frenzied Member
    Join Date
    Oct 2005
    Posts
    1,286

    Re: Listbox

    Hi,
    use the listview - more flexible, or use the grid.

    Personally I prefer the listview

    Pete
    Pete Vickers
    MVP - Device Application Development
    http://www.gui-innovations.com http://mobileworld.appamundi.com/blogs/

  3. #3

    Thread Starter
    PowerPoster Pasvorto's Avatar
    Join Date
    Oct 2002
    Location
    Minnesota, USA
    Posts
    2,951

    Re: Listbox

    I got it to work by doing two things:

    1. When I create the file on the PC, I padd with spaces to 'emulate' columns
    2. I use this code on the scanner to display the data from the flat file

    Private Sub frmLocation_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    Dim i As Integer
    objReader = New StreamReader("My Documents/LocationFile")
    ' MsgBox(CStr(objReader.Peek))
    If objReader.Peek = -1 Then
    objReader.Close()
    Exit Sub
    End If
    i = 0
    While objReader.Peek <> -1
    Dim strcontents As String

    strcontents = objReader.ReadLine()
    'MsgBox(strcontents)
    ListBox1.Items.Add(strcontents)

    i = i + 1
    End While
    objReader.Close()

    End Sub

    It seems to be working well enough for the 'proof of concept' demo.
    ===================================================
    If your question has been answered, mark the thread as [RESOLVED]

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