CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2003
    Posts
    5

    disable menus by selection

    I have s imple and stupid question to ask. I have some menu items that are disabled by default, I want them to enable when items in a listview are selected and then disbale again when nothing is selected. I just can't figure it out.

    Please help
    --
    Regards,
    Russ Green

  2. #2
    Join Date
    May 2002
    Location
    Toronto
    Posts
    167
    menu_item.enable = true

    menu_item.enable = false

  3. #3
    Join Date
    Oct 2002
    Location
    Växjö, Sweden
    Posts
    225
    One way to check if something is selected in the Listview is something like this.....

    Code:
    If ListView1.SelectedIndices.Count > 0 Then
        menu_item.Enabled = True 
    Else
        menu_item.Enable = False
    End If
    /Leyan

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

Featured