' Function(s) / Logic...
For lstBoxRow As Integer = 0 To lstBxOrder.ListCount - 1
For lstBoxCol As Integer = 0 To lstBxOrder.ColumnCount - 1
Next
lstBxHeldOrders.AddRow( lstBxOrder.CellValueAt( lstBoxRow, 0 ).ToText
lstBxHeldOrders.CellValueAt( lstBxHeldOrders.LastRowIndex, 1 ) = lstBxOrder.CellValueAt( 1 ).ToText
lstBxHeldOrders.CellValueAt( lstBxHeldOrders.LastRowIndex, 2 ) = lstBxOrder.CellValueAt( 2 ).ToText
lstBxHeldOrders.CellValueAt( lstBxHeldOrders.LastRowIndex, 3 ) = lstBxOrder.CellValueAt( 3 ).ToText
lstBxHeldOrders.CellValueAt( lstBxHeldOrders.LastRowIndex, 4 ) = lstBxOrder.CellValueAt( 4 ).ToText
Next
So I want to move, not copy, data from one ListBox to another. The code above is how I thought I could do this but… I am getting the following error(s):
frmActiveTill.btnSaleHold.MouseDown, line 22 Syntax error
lstBxHeldOrders.AddRow( lstBxOrder.CellValueAt( lstBoxRow, 0 ).ToText
frmActiveTill.btnSaleHold.MouseDown, line 23
There is more than one method with this name but this does not match any of the available signatures.
lstBxHeldOrders.CellValueAt( lstBxHeldOrders.LastRowIndex, 1 ) = lstBxOrder.CellValueAt( 1 ).ToText
You don’t need .ToText in your code. CellValueAt returns a string, so in effect, you are converting the string to Text and then converting it back to string when you set the cell value in lstBxHeldOrders.
actually “everyone should consult the documentation thoroughly before asking questions on here” since there were several answers that would work but were way more code than required
If you use the IDE and after listbox. press TAB you will see AllRows = -1 and AllColumns = -1 as options. In other words, you can use (-1, -1) or (Listbox.AllRows, Listbox.AllColumns)
Neither did I. But that’s why I said the OP should read the CellValueAt doc page. I’ve not wanted to copy from one listbox to another, so I’ve probably seen that but not registered it.
I’ve got issues with the docs, but there is a lot of info there.