Listbox will not accept user sequential input on same column

I have a simple ListBox with one editable column. In the Window Open event handler, I have this code:

Listbox_CL.ColumnCount = 10 Listbox_CL.ColumnWidths = "5%, 10%,11%,11%,14%,14%,8%,8%,8%,11%" Listbox_CL.HasHeading = True ListBox_CL.Heading(0) = "No." Listbox_CL.Heading(1) = "Switch" Listbox_CL.Heading(2) = "Type" Listbox_CL.Heading(3) = "Status" Listbox_CL.Heading(4) = "Raw Text" Listbox_CL.Heading(5) = "String" Listbox_CL.Heading(6) = "Numeric" Listbox_CL.Heading(7) = "Boolean" Listbox_CL.Heading(8) = "Error" Listbox_CL.Heading(9) = "Message" ListBox_CL.ColumnType(1) = ListBox.TypeEditable

When the program is running, and with many rows defined in the ListBox, when I click on any cell in the editable column (column 1 with heading “Switch”), my click is ignored, and I cannot edit the cell unless I immediately precede that click with a click on a non-editable cell. So for example, if there are 5 rows, and I want to edit the Switch cell in the third row (Cell 2,1), I must first click on an adjacent cell (that cannot be edited) and THEN click on Cell 2,1. Only then will my program respond to my click and allow me to input data.

If I do not click on an non-editable cell before clicking on Cell 2,1, the click to edit cell 2,1 is ignored, even when I click on cell 2,1 repeatedly.

If I want to update the whole column 1, for EACH column, I have to click on a non-editable cell before clicking on the editable cell, so the click sequence to update the whole row might be:

[quote]Click 0,2 - Click 0,1 - Enter data
Click 1,2 - Click 1,1 - Enter data
Click 2,2 - Click 2,1 - Enter data
Click 3,2 - Click 3,1 - Enter data
etc.[/quote]

I can’t see what I am doing wrong, and I can’t believe a bug so fundamental would have survived this long without correction. I’d appreciate any pointers in the right direction.

Thanks in advance.

Alex

For first have the row selected before a click will edit the cell.

If you want to edit regardless of selection use

ListBox.EditCell in MouseDown or CellClick events

  • Karen

I think the first click select the row and then clicking again will enter the cell edit. From my test, you can click once to select the row on any cell (including the one you want to edit), then click again on the cell you want to edit.

Edit: Karen posted while I was writing. Good info Karen.

[quote=443271:@Karen Atkocius]If you want to edit regardless of selection use

ListBox.EditCell in MouseDown or CellClick events[/quote]

Thanks Karen - I knew there had to be a simple way.