-
[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.
-
Re: Listbox
Hi,
use the listview - more flexible, or use the grid.
Personally I prefer the listview
Pete
-
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.