Results 1 to 5 of 5

Thread: Who Owns the ContextMenu?

  1. #1

    Thread Starter
    Frenzied Member Mike Hildner's Avatar
    Join Date
    Jul 2002
    Location
    Des Moines, NM
    Posts
    1,690

    Who Owns the ContextMenu?

    If you have a ContextMenu that is used by several, say ListViews, can you determine which ListView the menu was called from? I'd like to do this from one of the menu's MenuItems.

    Thanks,
    Mike

  2. #2
    Lively Member TLord's Avatar
    Join Date
    Jun 2004
    Posts
    95
    use the ListView.SelectedItems property array, if you disable multiselect for the list view, simply use it as a single item array: ListView.SelectedItems(0)
    Do you think my life is easy?
    Do you think it's good to win?
    do you think it's nice to kill?
    Do you think learning is a must?
    Do you think computers are nothing?
    Do you think this post is stupid?
    Do ypu think we're really humen?

    DO YOU THINK IT'S GOOD TO THINK AT ALL? ? ? ! ! !

  3. #3

    Thread Starter
    Frenzied Member Mike Hildner's Avatar
    Join Date
    Jul 2002
    Location
    Des Moines, NM
    Posts
    1,690
    Umm, I don't get it, maybe I wasn't clear. I have two ListViews and one ContextMenu. Both ListViews use the same ContextMenu. The ContextMenu's MenuItems are Large Icon, Details, Small Icon and List. What I want to do is change the view of the ListView based on what the user selects. But I need to know which ListView the user right-clicked on to bring up the ContextMenu. Not sure if I really need two ContextMenus that do the exact same thing except for the ListView it's acting on.

  4. #4

    Thread Starter
    Frenzied Member Mike Hildner's Avatar
    Join Date
    Jul 2002
    Location
    Des Moines, NM
    Posts
    1,690
    Reading you post again, TLord, that would work to find out which item in the list view was right clicked, but not which ListView.

  5. #5
    Lively Member TLord's Avatar
    Join Date
    Jun 2004
    Posts
    95
    use the ListViewItem.ListView read-only property.

    This property includes reference to the ListView control that holds this ListView Item.
    Do you think my life is easy?
    Do you think it's good to win?
    do you think it's nice to kill?
    Do you think learning is a must?
    Do you think computers are nothing?
    Do you think this post is stupid?
    Do ypu think we're really humen?

    DO YOU THINK IT'S GOOD TO THINK AT ALL? ? ? ! ! !

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width