473,836 Members | 2,102 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to block itemCheck event when I doubleClick in a listView

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 double-clicked. Is this possible?

Thanks!

Bright
Nov 15 '05 #1
4 5402
Bright,

I don't think it is, you will have to code for it yourself. I think it
make sense though, as you need a single click to occur if you are going to
perform a double click.

What you could do is override the WndProc method and handle the
WM_LBUTTONUP message (or WM_LBUTTONDOWN) message. Once you have that, you
can set a timer to fire in the amount of time that a double click would
occur (the threshold). If the double click event fires, then cancel the
timer. If it doesn't, when the timer fires, fire the single click event,
and select the item.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Bright Sun" <su********@hot mail.com> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
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 double-clicked. Is this possible?

Thanks!

Bright

Nov 15 '05 #2
Thanks for your reply, Nicholas Paldino. But I have not got it yet. Do you
mind to give me a simple example please?

Bright

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote in
message news:e0******** *****@TK2MSFTNG P10.phx.gbl...
Bright,

I don't think it is, you will have to code for it yourself. I think it make sense though, as you need a single click to occur if you are going to
perform a double click.

What you could do is override the WndProc method and handle the
WM_LBUTTONUP message (or WM_LBUTTONDOWN) message. Once you have that, you
can set a timer to fire in the amount of time that a double click would
occur (the threshold). If the double click event fires, then cancel the
timer. If it doesn't, when the timer fires, fire the single click event,
and select the item.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Bright Sun" <su********@hot mail.com> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
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 double-clicked. Is this possible?

Thanks!

Bright


Nov 15 '05 #3
Bright,

What do you have? How have you implemented this?

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Bright Sun" <su********@hot mail.com> wrote in message
news:uw******** ******@TK2MSFTN GP09.phx.gbl...
Thanks for your reply, Nicholas Paldino. But I have not got it yet. Do you
mind to give me a simple example please?

Bright

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote in message news:e0******** *****@TK2MSFTNG P10.phx.gbl...
Bright,

I don't think it is, you will have to code for it yourself. I think

it
make sense though, as you need a single click to occur if you are going to perform a double click.

What you could do is override the WndProc method and handle the
WM_LBUTTONUP message (or WM_LBUTTONDOWN) message. Once you have that, you can set a timer to fire in the amount of time that a double click would
occur (the threshold). If the double click event fires, then cancel the
timer. If it doesn't, when the timer fires, fire the single click event, and select the item.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Bright Sun" <su********@hot mail.com> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
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 double-clicked. Is this possible?

Thanks!

Bright



Nov 15 '05 #4
Hi Nicholas,

I have a ListView that is shown in Details mode. When I doubleclick an item,
I do not want change the checkbox status. Whatever a sample that can block
the itemCheck event will be fine. The thing is I do not know how to capture
the timer to decide a event is a doubleclick or not. Any sample can do this
will be great.

Thanks in ahead.

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote in
message news:eQ******** ******@TK2MSFTN GP12.phx.gbl...
Bright,

What do you have? How have you implemented this?

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Bright Sun" <su********@hot mail.com> wrote in message
news:uw******** ******@TK2MSFTN GP09.phx.gbl...
Thanks for your reply, Nicholas Paldino. But I have not got it yet. Do you
mind to give me a simple example please?

Bright

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c om> wrote in
message news:e0******** *****@TK2MSFTNG P10.phx.gbl...
Bright,

I don't think it is, you will have to code for it yourself. I think
it
make sense though, as you need a single click to occur if you are

going to perform a double click.

What you could do is override the WndProc method and handle the
WM_LBUTTONUP message (or WM_LBUTTONDOWN) message. Once you have that, you can set a timer to fire in the amount of time that a double click
would occur (the threshold). If the double click event fires, then cancel the timer. If it doesn't, when the timer fires, fire the single click

event, and select the item.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Bright Sun" <su********@hot mail.com> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
> 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 double-clicked. Is this possible?
>
> Thanks!
>
> Bright
>
>



Nov 15 '05 #5

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

Similar topics

2
410
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 event that has occurred because of a mouse click on a Checkbox, and one that has occurred because the .Checked property of an item has been changed programatically? More details if needed, but if you can answer the above, you'll have solved the...
4
1894
by: Ray Mitchell | last post by:
Hello, I have a standard ListView control with the CheckBox and MultiSelect properties enabled. I have an ItemCheck event set up so I can do some work every time an item is checked/unchecked. Let's assume I have two items in the list. The weird part comes when I hold down the control key and select (not check) the items one at a time. When I select the first one it works fine. However, when I select the second one it does become...
0
1412
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 don't want the checkboxes being activated when items in the ListView are double-clicked (except when click on the checkbox). Is this possible? Thanks!
3
5392
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 event? Boris
0
1143
by: Richard Myers | last post by:
Hello Can anyone tell me what im missing in handling the ItemCheck event of a winforms listview. I want the item to be selected if the check box is checked and not/unhighlighted when it is not. This should be extraordinarily simple. I am using Private Sub lvSites_ItemCheck(ByVal sender As Object, ByVal e As System.Windows.Forms.ItemCheckEventArgs) Handles lvSites.ItemCheck Me.lvSites.Items(e.Index).Selected = Not CBool(e.CurrentValue =
0
1229
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 newvalue become currentvalue after the event? I'm worring about this because 'listview1.CheckedItems.Count()' didn't change after I changed listview1's check state' Thank you
0
1055
by: Dred | last post by:
'ello I have a listview with checkboxes displaying several options. When one is checked, all it's mutually exclusive counterparts are removed. The problem is that if I check an Item, and remove one of it's previous siblings in the ItemCheck Event, the item does not display as checked. Once I call refresh() it displays fine. Is there some event that gets called after ItemCheck that I can
2
6647
by: ian.watkins | last post by:
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:
3
2330
by: sherifffruitfly | last post by:
Hi, Here's a skeleton-handler of what I'm trying to do: private void editBbListView_ItemCheck(object sender, System.Windows.Forms.ItemCheckEventArgs e) { string qEnabled = ""; string indexid = ITEM_IN_ROW_WHOSE_CHECK_JUST_CHANGED.Text;
0
9812
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10532
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10577
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10243
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9359
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7775
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6975
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5812
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4003
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.