ListView Query.

G

Guest

Hi

I am using a ListView with "Full Row Select" propert set to true. Now I want a handle a simple menu item click event. That is I want to know that a menu item is clicked. I used SelectedIndexChanged event. But it fires an event only if I am clicking on a different menu item (or different row) but what if I click on the same menu item(or on the same row) So it does not work. Also I used the ItemActivate event, but still I am not getting the satisfactory result. So which event should I trap to get the click event and how

Thanks in advance
Amit.
 
G

Ginny Caughey [MVP]

Amit,

I'm not sure I follow you. Is the menu you're referring to a context menu?
Or are you using the listview as a menu?
--
Ginny Caughey
..Net Compact Framework MVP

Amit Patankar said:
Hi,

I am using a ListView with "Full Row Select" propert set to true. Now I
want a handle a simple menu item click event. That is I want to know that a
menu item is clicked. I used SelectedIndexChanged event. But it fires an
event only if I am clicking on a different menu item (or different row) but
what if I click on the same menu item(or on the same row) So it does not
work. Also I used the ItemActivate event, but still I am not getting the
satisfactory result. So which event should I trap to get the click event and
how?
 
A

Alex Feinman [MVP]

Instead of Click event use ItemActivate event. To be able to do that set
Activation property to ActivationType.OneClick

--
Alex Feinman
---
Visit http://www.opennetcf.org
Amit Patankar said:
Hi,

I am using a ListView with "Full Row Select" propert set to true. Now I
want a handle a simple menu item click event. That is I want to know that a
menu item is clicked. I used SelectedIndexChanged event. But it fires an
event only if I am clicking on a different menu item (or different row) but
what if I click on the same menu item(or on the same row) So it does not
work. Also I used the ItemActivate event, but still I am not getting the
satisfactory result. So which event should I trap to get the click event and
how?
 
G

Guest

Thanks a ton...
Another thing remains is what is the event fired when I click outside a modeless form(Form which is shown using show / hide properties) That is, anywhere outside the form, it may be on the menubar, or on the title bar, etc. What I am trying to do is, if the user clicks outside the form the form should get closed( hide property = true). I tried with LostFocus but its not working..:(

Thanks once again.
Amit.
 
A

Alex Feinman [MVP]

Try Form.Deactivate. It's not in the designer, but you can attach a handler
programmatically - myForm.Deactivate += new EventHandler(....

--
Alex Feinman
---
Visit http://www.opennetcf.org
Amit PAtankar said:
Thanks a ton...
Another thing remains is what is the event fired when I click outside a
modeless form(Form which is shown using show / hide properties) That is,
anywhere outside the form, it may be on the menubar, or on the title bar,
etc. What I am trying to do is, if the user clicks outside the form the form
should get closed( hide property = true). I tried with LostFocus but its not
working..:(
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top