Private Sub Bouton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Bouton1.Click
Dim WithEvents bouton1 As Button
Public Class Form1 Dim bouton1 As Button Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load bouton1 = New Button bouton1.Location = New System.Drawing.Point(50, 50) bouton1.Text = "cliquez ici" Me.Controls.Add(bouton1) --> AddHandler Bouton1.Click, AddressOf Bouton1_Click End Sub Private Sub Bouton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) MsgBox("bonjour") End Sub End Class
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question