CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4

Thread: .Net Conversion

  1. #1
    Join Date
    Aug 2004
    Posts
    184

    Cool .Net Conversion

    Can someone tell me what the Equilivent is in .net of the following Event

    Code:
     
    Private Sub ListView_ItemDblClick(Item As ListItem)
        
    End Sub
    I need to know when the user Double Clicks on an icon in a ListView, there doesn't seem to be a matching event in .net.

    I'm running VS 2008

  2. #2
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: .Net Conversion

    windows form? Should be:
    Code:
    Private Sub ListView1_DoubleClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ListView1.DoubleClick
    
    End Sub
    the point is: not the name of the routine, like in Vb6, but the Handles make this routine triggers when the user perform that action.
    If you neeed to bind a routine at runtime to an event, take a look at the
    AddHadler (and RemoveHandler) keyword in help
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

  3. #3
    Join Date
    Aug 2004
    Posts
    184

    Cool Re: .Net Conversion

    Thanks i know about The "ListView_DoubleClick()" event
    but that is triggered when the user clicks anywhere on the listview, i need an item specific event there only seems to be one for a single click
    Code:
    ListView_ItemSelectionChanged(ByVal sender As Object, ByVal e As System.Windows.Forms.ListViewItemSelectionChangedEventArgs) Handles ListView.ItemSelectionChanged
    And i know about AddHandler, that seems to be how its done in C# and other languages

  4. #4
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: .Net Conversion

    You can do the same in VB
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

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