Jump to content
Sign in to follow this  
BCW0928

How to Right Click On an item in the ListView

Recommended Posts

BCW0928

Hey Guys, I'm trying to do the following:

I have a ListView Control is pre-created. It has Item1,2,3,4,5,6,7. I would like to right click on one of the item in the list, let's say 3, and bring up the Context Manue. then I would like to verify if the items in the context manu are enable or disabled.

Anyone has any ideal?

Share this post


Link to post
Share on other sites
furrycow

Hey Guys, I'm trying to do the following:

I have a ListView Control is pre-created. It has Item1,2,3,4,5,6,7. I would like to right click on one of the item in the list, let's say 3, and bring up the Context Manue. then I would like to verify if the items in the context manu are enable or disabled.

Anyone has any ideal?

Don't know if theres an easier way, but using _GUICtrlListView_GetHotItem($hWnd) would work..

If you look in the helpfile for that function, and look at the example that is given, there is an option under there to determine whether an item has been right-clicked.

Good luck.


Instant Lockerz Invite - www.instantlockerzinvite.co.uk

Share this post


Link to post
Share on other sites
BCW0928

Don't know if theres an easier way, but using _GUICtrlListView_GetHotItem($hWnd) would work..

If you look in the helpfile for that function, and look at the example that is given, there is an option under there to determine whether an item has been right-clicked.

Good luck.

Thanks, I was realize that there are functions for _GUICtrlListView. I think we can use the following sequence to right click the item. first use ControlListView() or _GUICtrlList_View_FindItem() functions to find the "Index" of the item in the list. Then use _GUICtrlListView_ClickItem() function to right click the "Index" item in the List.

However, my second part of the question is that when we right click the item in the list, a context manu appear. I would like to know if the items in the context menu are enabled or disabled. Anyone has any idea for it?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.