Results 1 to 5 of 5

Thread: enable/disable menu based on listview selection

  1. #1

    Thread Starter
    Frenzied Member longwolf's Avatar
    Join Date
    Oct 2002
    Posts
    1,343

    enable/disable menu based on listview selection

    I want to enable/disable a menu option depending on wether or not an item is selected in a listview.

    Is there some event I can use to tell if an item is selected?

  2. #2
    Hyperactive Member
    Join Date
    Mar 2006
    Posts
    266

    Re: enable/disable menu based on listview selection

    you can use click event of list view...whenever user click on an item its relevant menu would b enable or disable....

    well if u could explain a lil more then i couold better give u its answer

  3. #3
    Just Married shakti5385's Avatar
    Join Date
    Mar 2006
    Location
    Udaipur,Rajasthan(INDIA)
    Posts
    3,747

    Re: enable/disable menu based on listview selection

    Private Sub LiST_Click()
    If LiST.ItemData(LiST.ListIndex) = 1 Then
    Menu1.enabled=false
    End If
    End Sub

  4. #4

    Thread Starter
    Frenzied Member longwolf's Avatar
    Join Date
    Oct 2002
    Posts
    1,343

    Re: enable/disable menu based on listview selection

    I guess I'm tired.
    Enabling the menu won't be had.
    But what can I use to tell when to disable the menu?

    I know I can use the lostfocus event.
    But I have a Delete Item feature.
    When it gets used the listview is still active, but there's no longer a selected item.
    Last edited by longwolf; May 15th, 2006 at 12:39 AM.

  5. #5
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: enable/disable menu based on listview selection

    Quote Originally Posted by longwolf
    Enabling the menu won't be had.
    I don't understand what you mean by this.
    Quote Originally Posted by longwolf
    But what can I use to tell when to disable the menu?
    Under what circumstances should the menu item be disabled? Under what circumstances should it be reenabled? What is/are the menu item(s) that we are talking about?
    Quote Originally Posted by longwolf
    I know I can use the lostfocus event.
    The LostFocus event of what control?
    Quote Originally Posted by longwolf
    But I have a Delete Item feature. When it gets used the listview is still active, but there's no longer a selected item.
    That would be correct, so the user would have to select something else. If something has been deleted, how does that effect your menu? (If, 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