QUOTE(sam_wong @ 14 Oct, 2008 - 05:02 AM)

i'm having trouble generating the autonumber for the list box.
once i click the button all the number will shows in the list box.i just wan a number showing once at a time but not the whole list of number.can anyone help?
CODE
Private Sub AutoNumber()
Dim iMax As Integer = 100
Const sChar As String = "PO"
Dim iCounter As Integer
For iCounter = 0 To iMax
lstOrderID.Items.Add(sChar & iCounter)
Next iCounter
iCounter = iCounter + 1
End Sub
*Appreciate your help*
i think yoi want to add the number one by one ok lets check this
declare the icounter at form level (i.e) declare in the general section
in the button click add the coding
vb
if iCounter<=imax then
lstOrderID.Items.Add(sChar & iCounter)
endif
when you click the button the list will add one by one
This post has been edited by thava: 14 Oct, 2008 - 06:31 AM