Ceriwis

Ceriwis (https://forum.ceriwis.com/forum.php)
-   Programming (https://forum.ceriwis.com/forumdisplay.php?f=63)
-   -   [ask] VB 2005 buat button nambah event OnClicknya gagal (https://forum.ceriwis.com/showthread.php?t=573650)

Servermaster 20th November 2011 02:04 AM

[ask] VB 2005 buat button nambah event OnClicknya gagal
 

Saya mau buat button dengan codingan. Dan berhasil. Sekarang saya mau tambah'i action onClick didalamnya tapi kok gagal ya??



Ini listing programnya


Code:

Public Class Form1
Dim b As New Button
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
b.Text = "Coba"
Me.Controls.Add(b)
End Sub

Private Sub b_onClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles b.Click 'Disini errornya.
b.Width = b.Width * 2
Me.Controls.Add(b)
End Sub
End Class

Katanya errornya "Handles clause requires a WithEvents variable defined in the containing type or one of its base types."



Kenapa ya?



Maklum baru belajar VB

</div>


All times are GMT +7. The time now is 12:19 PM.