Ceriwis  

Go Back   Ceriwis > HOBI > Komputer & Teknologi > Programming

Programming Share, tanya jawab, saling bantu antar programmer dengan berbagai macam bahasa pemrograman.

Reply
 
Thread Tools
  #1  
Old 20th November 2011
Servermaster Servermaster is offline
Member Aktif
 
Join Date: Nov 2011
Posts: 257
Rep Power: 14
Servermaster mempunyai hidup yang Normal
Default [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



Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


 


All times are GMT +7. The time now is 11:39 AM.


no new posts