Results 1 to 4 of 4

Thread: [RESOLVED] [2005]combination of handles (small question)

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jun 2006
    Posts
    103

    Resolved [RESOLVED] [2005]combination of handles (small question)

    A little stupid question (i think) but is there a way to combine 2 combobox handles

    example:
    VB Code:
    1. Private Sub combobox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles combobox1.Leave OR Handles combobox1.SelectedIndexChanged


    greetz and thx,
    freakyme
    VB.NET 2005 n00b

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2005]combination of handles (small question)

    VB Code:
    1. Private Sub combobox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles combobox1.Leave, combobox1.SelectedIndexChanged
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Jun 2006
    Posts
    103

    Re: [2005]combination of handles (small question)

    super thx for the reply

    probleme solved
    VB.NET 2005 n00b

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [RESOLVED] [2005]combination of handles (small question)

    Note that one method can handle as many events as you like, providing the signature is the same for each event. That means that the argument lists must match. If you want to execute the same code on more than one event with different signatures you'd have to do this:
    VB Code:
    1. Private Sub ComboBox1_Leave(ByVal sender As Object, ByVal e As System.EventArgs) Handles ComboBox1.Leave
    2.     Me.DoSomething()
    3. End Sub
    4.  
    5. Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
    6.     Me.DoSomething()
    7. End Sub
    8.  
    9. Private Sub DoSomething()
    10.     'Place code here.
    11. End Sub
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

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