473,397 Members | 2,099 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

listview itemcheck event problem

I'm having a problem with the listview itemcheck event since upgrading
a smart device app from VS2003 VB.NET CF1.0 to VS2005 VB.NET CF2.0.

I'm using the listview item checkbox to indicate if the item is
"processed". When the item becomes processed, i set the
listviewitem.checked property to true.

To prevent the user from changing the state of the box manually, i use
the itemcheck event and set:

e.NewValue = e.CurrentValue
This worked fine in VS2003, but now, when i set the checked property to
true, the itemcheck event is being kicked off and sets it back to false
(unchecked).

Can anyone help!
Ian.

Aug 9 '06 #1
2 6591
Turn off the event handler before you set the check state and then turn it
on again when you're done. Something like this:

RemoveHandler myListView.ItemCheck, AddressOf myListView_ItemCheck
myListViewItem.Checked = True
AddHandler myListView.ItemCheck, AddressOf myListView_ItemCheck

/claes

<ia*********@vscsolutions.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
I'm having a problem with the listview itemcheck event since upgrading
a smart device app from VS2003 VB.NET CF1.0 to VS2005 VB.NET CF2.0.

I'm using the listview item checkbox to indicate if the item is
"processed". When the item becomes processed, i set the
listviewitem.checked property to true.

To prevent the user from changing the state of the box manually, i use
the itemcheck event and set:

e.NewValue = e.CurrentValue
This worked fine in VS2003, but now, when i set the checked property to
true, the itemcheck event is being kicked off and sets it back to false
(unchecked).

Can anyone help!
Ian.

Aug 10 '06 #2
Thanks Claes.

That worked.

Ian.

Claes Bergefall wrote:
Turn off the event handler before you set the check state and then turn it
on again when you're done. Something like this:

RemoveHandler myListView.ItemCheck, AddressOf myListView_ItemCheck
myListViewItem.Checked = True
AddHandler myListView.ItemCheck, AddressOf myListView_ItemCheck

/claes

<ia*********@vscsolutions.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
I'm having a problem with the listview itemcheck event since upgrading
a smart device app from VS2003 VB.NET CF1.0 to VS2005 VB.NET CF2.0.

I'm using the listview item checkbox to indicate if the item is
"processed". When the item becomes processed, i set the
listviewitem.checked property to true.

To prevent the user from changing the state of the box manually, i use
the itemcheck event and set:

e.NewValue = e.CurrentValue
This worked fine in VS2003, but now, when i set the checked property to
true, the itemcheck event is being kicked off and sets it back to false
(unchecked).

Can anyone help!
Ian.
Aug 15 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Mike Ruane-Torr | last post by:
I have a design problem involving a ListView control on a Windows form. What it boils down to is the following question: Q: Is there a way to tell the difference between a ListView.ItemCheck...
2
by: Aaron Queenan | last post by:
Is there any way to know whether the OnItemCheck is being called in response to a user action (mouse or keyboard) as opposed to the form loading? I have a class which derives from...
4
by: Bright Sun | last post by:
Hi, I have a ListView that is shown in Details mode, and the Checkboxes property is set to true. My problem is that I dont want the checkboxes being activated when items in the ListView are...
3
by: Boris | last post by:
I wonder when CheckedListViewItemCollection is updated? Before ItemCheck event? After the event? How to force CheckedListViewItemCollection to show updated items list after check in the ItemCheck...
3
by: | last post by:
Hello, I have a ListView control in Details view. When an item is un-checked, I want to change the ForeColor. The only way I have found to do this is to loop through all the items of the...
0
by: Peter | last post by:
Hi,everyone, I'm using a listview control to deal with data. The ItemCheckEventArgs have 2 properties:CurrentValue and NewValue in listview.itemcheck event. Can anybody tell me when does the...
2
by: samoore33 | last post by:
I am working with a program that utilized the checkbox property of a listview. When a user clicked on the checkbox, it was suppose to calculate and total some prices. I did not make any changes to...
1
by: dvestal | last post by:
I have a ListView with checkboxes. I want to remove items when the checkboxes are unchecked, but to do so yields an ArgumentOutOfRangeException. Is there an easy way to get around this? A...
2
by: Peter | last post by:
Hi, I have a problem with Listview using checkboxes. If i check items by code BEFORE the form is shown the Listview.Items are confused during the ItemChecked Event !!! After showing the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.