473,387 Members | 1,540 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,387 software developers and data experts.

Obtain the index of a just clicked checkBox

Greetings!
I develop a multiple forms application in Microsoft Visual
Studio C++ .NET 2003. I am working with a listView with checkBoxes and
an event relative to the clicking of a checkBox in this list
(listView1_ItemCheck). When the event starts, I need to know which was
the check checkBox (its index) that shot the event. But I do not get to
do that.. I've already tryed:
- Use the "listView::CheckedItems" property, but it appears that the
item is checked just when the event is finished...so the box I checked
is not counted in "CheckedItems" property

- Use a dynamic_cast...
ListViewItem* checkedItem = dynamic_cast<ListViewItem*>(se*nder);
int index=checkedItem->get_Index()*;

None work... any idea of how to get the index of the checked item is
welcome.
Marcelo Roggia Schio

Nov 17 '05 #1
2 1070
I think the Index property of the ItemCheckEventArgs argument is what you
need.

"Marcelo" <ma******@msn.com> wrote in message
news:11*********************@o13g2000cwo.googlegro ups.com...
Greetings!
I develop a multiple forms application in Microsoft Visual
Studio C++ .NET 2003. I am working with a listView with checkBoxes and
an event relative to the clicking of a checkBox in this list
(listView1_ItemCheck). When the event starts, I need to know which was
the check checkBox (its index) that shot the event. But I do not get to
do that.. I've already tryed:
- Use the "listView::CheckedItems" property, but it appears that the
item is checked just when the event is finished...so the box I checked
is not counted in "CheckedItems" property

- Use a dynamic_cast...
ListViewItem* checkedItem = dynamic_cast<ListViewItem*>(se*nder);
int index=checkedItem->get_Index()*;

None work... any idea of how to get the index of the checked item is
welcome.
Marcelo Roggia Schio
Nov 17 '05 #2
That's right. I thank you very much.
I hadn't realyzed this property...
Marcelo Roggia Schio

Nov 17 '05 #3

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

Similar topics

5
by: Steve Wylie | last post by:
What is the syntax for finding out the element index number from a specific element on a form? For example, if you do OnClick="document.forms.elements.checked=true", then when that element is...
7
by: Shaldaman | last post by:
Hi Is there a property in MS Access for the following: 1) For a Command Button on a form, is there a property that can be used to determine if it has been clicked? eg: Me!button7.Clicked - I...
3
by: John Smith | last post by:
Hey folks, Does anyone know if it's possible for me to determine on a checkbox's checkedchanged event whether the actual box was clicked or if it's text was clicked? I know with DataGrids you...
4
by: Microsoft | last post by:
Hey I have checkbox control in template of the datagrid. In the item_created event of dg, I added clickevent( maybe it's change event, doesn't matter ) to the checkbox. But I want to know which...
1
by: puneet.bansal | last post by:
Hi, I want to know the index of the option that a user clicks on in a multiple-select object (regardless of whether he selected or deselected it). This seems fairly simple but I can't seem to...
1
by: DotNetDev | last post by:
Hi, I have a datagrid. <asp:DataGrid id="DataGrid1" runat="server" Height="237px" Width="280px" AutoGenerateColumns="False" AlternatingItemStyle-BackColor="#e9e9e9" ShowHeader="false" ...
5
by: =?Utf-8?B?U2NhbmJveQ==?= | last post by:
Guyz, Whatever happened to the 'Index' property for a control, that used to be present in VB 3.0 / 4.0 / 5.0 / 6.0 and which now seems to be missing from VBE 2005? I need to be able to make 4...
7
by: bouy78 | last post by:
Quick Question Seems to be an easy task, but apparently I'm not very bright. I have an array of checkboxes, created at runtime and inserted in a panel. Upon creation, they're each attached to...
1
by: ahilar12 | last post by:
Hi all, I am new to php,my question is that in this following code i am retrieving many rows from the database which is working good.i want to delete a particular row(s) which is checked(checkbox)...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...

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.