First solution :
Private Sub cbxAll_CheckedChanged(sender As Object, e As System.EventArgs) Handles cbxAll.CheckedChanged
If cbxAll.Checked = True Then
cbx01.Checked = True
cbx02.Checked = True
cbx39.Checked = True
Else
cbx01.Checked = False
cbx02.Checked = False
cbx39.Checked = False
End If
End Sub
Second solution :
with the same event on checkbox(All) make a loop over all control of the form that match the name of the other 39 , if you name them in a proper way you can modify their property (.Checked = True/False).
Hope help