Please Help!! Arraylist of structures(2)

  • Thread starter Thread starter RBCC
  • Start date Start date
R

RBCC

I recently wrote this code, it lists the account numbers but the
textboxes are empty what is the problem? I can't seem to get it.

Dim trans_counter As Integer
Dim trans_read() As String
Do
trans_read = fv.ReadLine.Split(","c)
transaction.amount = trans_read(0)
transaction.type = Convert.ToString(trans_read(1))
transaction.number = trans_read(2)
array.Add(transaction)
trans_counter = +1
Loop Until fv.Peek = -1
Return array

End Function
Private Sub output_transactions(ByVal array As ArrayList)
Dim transactions As trans
Dim trans_counter As Integer
For Each transactions In array
lstaccounts.Items.Add(transactions.number)

Next
End Sub

Private Sub lstaccounts_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
lstaccounts.SelectedIndexChanged
Dim trans_array As ArrayList
txt_type.Text = transaction.type
txt_amount.Text = transaction.amount

End Sub
 
Hi,

The reason noting is showing in the textbox is because you are not
getting the data from the arraylist. Try using a class instead of a
structure. You can bind the listbox to an arraylist it will display the
specified property in the list. See my answer to your first question for an
example.


Ken
 
I am using the same arraylist, I have 2 textboxes and would like to use
what the user puts in textbox and put it into the arraylist how is this
done?
 
* John Marshall said:
I am using the same arraylist, I have 2 textboxes and would like to use
what the user puts in textbox and put it into the arraylist how is this
done?

For example, in a button's 'Click' event handler:

\\\
al.Add(Me.TextBox1.Text)
///
 
Back
Top