Private Sub Button1_Paint(ByVal sender As Object, _ ByVal e As System.Windows.Forms.PaintEventArgs) Handles Button1.Paint, Button2.Paint, Button3.Paint Dim buttonPath As New System.Drawing.Drawing2D.GraphicsPath Dim newRectangle As Rectangle = CType(sender, Windows.Forms.Button).ClientRectangle newRectangle.Inflate(-10, -10) newRectangle.Inflate(1, 1) buttonPath.AddEllipse(newRectangle) e.Graphics.DrawPath(Pens.Black, buttonPath) CType(sender, Windows.Forms.Button).Region = New System.Drawing.Region(buttonPath) End Sub
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionIf SActif(i) = True Then Me.Controls.Add(Choix(i)) : Me.Controls.Add(Etat(i)) Etat(i).Tag = i AddHandler Etat(i).Click, AddressOf CheckBox1_Click Next Catch ex As Exception End Try End Sub Private Sub CheckBox1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Select sender.tag Case 0 MsgBox("valeur 0") Case 1 MsgBox("valeur 1") Case 2 MsgBox("valeur 2") Case 3 MsgBox("valeur 3") End Select MsgBox(Me.Controls.Count) End Sub