Environment
- Windows XP x32 Visual Studio 2005 Standard Edition
- Honeywell Dolphin 9500 running Windows Mobile 2003 (Pocket PC 2003) With built-in barcode scanner and B & W camera Using its SDK located here .
- .NET Compact Framework 1.0 SP3 and .NET Framework 1.1
- Using VC #
goal
I have a ListView control with CheckBoxes = true and View = Details on the form, but I don’t want the checkboxes to be “checked” by the user. I use it to display the recording completion status. However, I want to use the event handler function to check the field through the code (i.e., End recording: lvMeters_ItemCheck(null, null); ).
Problem
I turned off checking the window itself (I think the touch screen is not accurate on this device). However, when selecting a row (I have FullRowSelect = true ), the control often checks the checkbox, and the event handler does not seem to be called.
Things i tried
I tried basically to undo the action in the event handler:
private void lvMeters_ItemCheck(object sender, ItemCheckEventArgs e) { if (sender is ListView) { if (e.CurrentValue == CheckState.Checked) lvMeters.Items[e.Index].Checked = true; else lvMeters.Items[e.Index].Checked = false; } else if (e.CurrentValue == CheckState.Checked) lvMeters.Items[e.Index].Checked = false; else lvMeters.Items[e.Index].Checked = true; }
The problem is that the above handler is not called when the list is selected, and the SelectedItemChanged event handler does not call this event handler, but it still checks the checkbox when it is selected. It is called when checking the window itself.
Need more info?
Ask and I will do my best!
I'm new at this
Therefore, please do not hesitate to tell me that I am doing this completely wrong and should do everything differently.
source share