nb_taches = Application.WorksheetFunction.CountA(Feuil4.Range("$A:$A"))
For i = 1 To nb_taches
Set ajouttache = Frame_taches.Controls.Add("forms.optionbutton.1", Name:="ajouttache" & i) ' partie la plus importante
Frame_taches.Controls("ajouttache" & i).Top = 15 + 15 * i
Frame_taches.Controls("ajouttache" & i).Caption = Feuil4.Range("a" & i)
ajoutqtetache = Frame_taches.Controls.Add("forms.textbox.1", Name:="ajoutqtetache" & i)
Frame_taches.Controls("ajoutqtetache" & i).Top = 15 + 15 * i
Frame_taches.Controls("ajoutqtetache" & i).Width = 30
Frame_taches.Controls("ajoutqtetache" & i).Left = 137
Frame_taches.Controls("ajoutqtetache" & i).Visible = False
Frame_taches.Controls("ajoutqtetache" & i).Value = 0
Next i
If nb_tache > 8 Then
Frame_taches.Height = 137
Frame_taches.Width = 175
Frame_taches.ScrollBars = fmScrollBarsVertical
Frame_agents.ScrollHeight = (16 * nb_taches) + 20
Else
Frame_taches.Height = 135
Frame_taches.Width = 170
Frame_taches.ScrollBars = fmScrollBarsNone
End If
End Sub
Private Sub Frame_taches_Click()
nb_taches = Application.WorksheetFunction.CountA(Feuil4.Range("$A:$A"))
For i = 1 To nb_taches
If Frame_taches.Controls("ajouttache" & i) = True Then
Frame_taches.Controls("ajoutqtetache" & i).Visible = True
Else
Frame_taches.Controls("ajoutqtetache" & i).Visible = False
End If
Next i
End Sub