J
Joe Cool
I have an app I am working on where I was using a ListBox to display a
list of items on a form. I decided I'd rather the control be a
ListView. But something that worked on the ListBox doesn't work the
same way as a ListView and I cannot find a way to overcome it.
The ListBox had a context menu and the form had a couple of command
buttons that operated on the selected item in the list. The context
menu items use the same click event as the command buttons. The
context menu items and command buttons are only enabled if an item was
selected. After clicking on one of the context menu items or the
corresponding command button, and the action in the click event is
processed, if the item still existed in the list, it was still
selected.
However, the ListView acts differently.
Remember, the context menu items link to the same click event handlers
as the buttons.
If you perform an action via the context menu, the item(s) selected
remain selected. If you perform the action via the command button, all
items are de-selected. EVEN THOUGH THE SELECTED PROPERTY IS STILL
TRUE!!!
Setting the Item's Selected property does not help.
I hope someone with more experiance than I can help!!!
TIA.
list of items on a form. I decided I'd rather the control be a
ListView. But something that worked on the ListBox doesn't work the
same way as a ListView and I cannot find a way to overcome it.
The ListBox had a context menu and the form had a couple of command
buttons that operated on the selected item in the list. The context
menu items use the same click event as the command buttons. The
context menu items and command buttons are only enabled if an item was
selected. After clicking on one of the context menu items or the
corresponding command button, and the action in the click event is
processed, if the item still existed in the list, it was still
selected.
However, the ListView acts differently.
Remember, the context menu items link to the same click event handlers
as the buttons.
If you perform an action via the context menu, the item(s) selected
remain selected. If you perform the action via the command button, all
items are de-selected. EVEN THOUGH THE SELECTED PROPERTY IS STILL
TRUE!!!
Setting the Item's Selected property does not help.
I hope someone with more experiance than I can help!!!
TIA.