Im pretty sure we can make this code looks well but i dont know how.

On form i have 7 checkboxes .

Name:  Untitled.jpg
Views: 107
Size:  17.8 KB

Each of those checkboxes on checked change is calling the same event.


Code:
  Private Sub Ebay_Mo_CheckedChanged(sender As Object, e As EventArgs) Handles Ebay_Mo.CheckedChanged
        If bLoadEbay = True Then
            Save_Ebay()
        End If
    End Sub

    Private Sub Ebay_Tu_CheckedChanged(sender As Object, e As EventArgs) Handles Ebay_Tu.CheckedChanged
        If bLoadEbay = True Then
            Save_Ebay()
        End If
    End Sub

    Private Sub Ebay_We_CheckedChanged(sender As Object, e As EventArgs) Handles Ebay_We.CheckedChanged
        If bLoadEbay = True Then
            Save_Ebay()
        End If
    End Sub

    Private Sub Ebay_Th_CheckedChanged(sender As Object, e As EventArgs) Handles Ebay_Th.CheckedChanged
        If bLoadEbay = True Then
            Save_Ebay()
        End If
    End Sub

    Private Sub Ebay_Fr_CheckedChanged(sender As Object, e As EventArgs) Handles Ebay_Fr.CheckedChanged
        If bLoadEbay = True Then
            Save_Ebay()
        End If
    End Sub

    Private Sub Ebay_Sa_CheckedChanged(sender As Object, e As EventArgs) Handles Ebay_Sa.CheckedChanged
        If bLoadEbay = True Then
            Save_Ebay()
        End If
    End Sub

    Private Sub Ebay_Su_CheckedChanged(sender As Object, e As EventArgs) Handles Ebay_Su.CheckedChanged
        If bLoadEbay = True Then
            Save_Ebay()
        End If
    End Sub

    Private Sub Ebay_At_ValueChanged(sender As Object, e As EventArgs) Handles Ebay_At.ValueChanged
        If bLoadEbay = True Then
            Save_Ebay()
        End If
    End Sub
I tried with adding handlers like

HTML Code:
 Private Sub Ebay_Sa_CheckedChanged(sender As Object, e As EventArgs) Handles Ebay_Sa.CheckedChanged, Ebay_Mo.CheckedChanged.....
        If bLoadEbay = True Then
            Save_Ebay()
        End If
    End Sub
Assuming on each form i have 7 check boxes it generates a lot of unnecessary code.