7 Replies - 2934 Views - Last Post: 01 May 2012 - 11:42 AM Rate Topic: -----

#1 evry1falls  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 44
  • Joined: 25-April 12

Choose items in ListView Ctrl using Right-Click .

Posted 28 April 2012 - 03:00 PM

Hello,
I have a listView Ctrl in VB 6.0 Project, i have a PopUpMenu, i want to trigger the PopUpMenu events by choosing items from my ListView Ctrl using Right Click mouse button .
it works but only when i Right Click anywhere on the listview, so i want the Right Click to choose item from ListView and trigger the PopUpMenu to parse events ..... is it doable ?!
Is This A Good Question/Topic? 0
  • +

Replies To: Choose items in ListView Ctrl using Right-Click .

#2 maj3091  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 299
  • View blog
  • Posts: 1,768
  • Joined: 26-March 09

Re: Choose items in ListView Ctrl using Right-Click .

Posted 29 April 2012 - 12:10 AM

On the listview mousedown event you could set a flag to indicate which button was pressed.

Then in the listview ItemClick event you check whether it was the Right mouse button and do what you want under there.

It's just a suggestion, so give it a go and see if it gives you what you want.
Was This Post Helpful? 1
  • +
  • -

#3 BobRodes  Icon User is offline

  • Your Friendly Local Curmudgeon
  • member icon

Reputation: 572
  • View blog
  • Posts: 2,985
  • Joined: 19-May 09

Re: Choose items in ListView Ctrl using Right-Click .

Posted 30 April 2012 - 07:28 AM

I believe what you are asking to do is to right click on any line item in the listbox and have the menu differ based on which item you have clicked. I'm not sure that this functionality is available without going to the API. In any case, it isn't standard Windows behavior, either, so you may wish to state what you want to accomplish and ask the best way to do it in terms of UI behavior.
Was This Post Helpful? 1
  • +
  • -

#4 evry1falls  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 44
  • Joined: 25-April 12

Re: Choose items in ListView Ctrl using Right-Click .

Posted 01 May 2012 - 08:38 AM

Thank you for replying, the thing is that i wanted to left-click on list item and then when i right-click on it it displays popupmenu, but when i left-click on a lit item then i go way from it to another item and then right-click i display the popupmenu although i don't want to show it upon the other item ... so i wanted something to capture the item where the mouse is on and displays relevant popupmenu ... for example :

i have list4 contains 10 items (folders and files) ... i have 2 popupmenus (folder option and file option) ....
not i left-click a (folder) and and then right-click , so it displays the right menu, but when i right-click on a (file) it still displays the (folder option menu) .... !

anyway .... i assigned popupmenu on left-click instead .!
Was This Post Helpful? 0
  • +
  • -

#5 Neku  Icon User is offline

  • D.I.C Regular

Reputation: 20
  • View blog
  • Posts: 268
  • Joined: 21-May 09

Re: Choose items in ListView Ctrl using Right-Click .

Posted 01 May 2012 - 09:09 AM

maybe if you post the code you used for right click popup you could get extra help to make it the way you wanted
Was This Post Helpful? 1
  • +
  • -

#6 evry1falls  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 44
  • Joined: 25-April 12

Re: Choose items in ListView Ctrl using Right-Click .

Posted 01 May 2012 - 09:21 AM

Here you are : http://www.dreaminco...t-into-listbox/

this the original project i'm trying to finish, download the Attachments and see for yourself the Key_Down for list4.

remember : i wanted to use thr right-click.
Was This Post Helpful? 0
  • +
  • -

#7 BobRodes  Icon User is offline

  • Your Friendly Local Curmudgeon
  • member icon

Reputation: 572
  • View blog
  • Posts: 2,985
  • Joined: 19-May 09

Re: Choose items in ListView Ctrl using Right-Click .

Posted 01 May 2012 - 10:37 AM

I wouldn't use left click for a popup menu either, since the standard is to use right click. Also, it would be better if you would post the keydown code directly, rather than asking people to download attachments. most of us won't do that for security reasons.

Now, I don't have VB6 up to test this, but I don't think that right clicking changes the selection in a list box. If that's so, then you should be able to base your popup menu on whatever the selected value is in the list box.
Was This Post Helpful? 1
  • +
  • -

#8 evry1falls  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 44
  • Joined: 25-April 12

Re: Choose items in ListView Ctrl using Right-Click .

Posted 01 May 2012 - 11:42 AM

@BobRodes
Ok, Thank you.
I really am over this part of my project for now at least.
the other post though is the one that matters now ....
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1