Getting Build Errors in Program to Change Button Name When Clicked

Posted by Rishabh on Stack Overflow See other posts from Stack Overflow or by Rishabh
Published on 2010-06-13T09:29:01Z Indexed on 2010/06/13 9:32 UTC
Read the original article Hit count: 153

Filed under:
|
Imports System
Imports System.Windows.Forms
Class MyButtonClass
    Inherits Form

    Private mrButton As Button
    Public Sub MyButtonClass()

        mrButton = New Button()
        mrButton.Text = "Click me "
        mrButton.Click += New System.EventHandler(MyButtonClickEventHandler)
        Me.Controls.Add(mrButton)
    End Sub
    Shared Sub Main()
        Application.Run(New MyButtonClass())
    End Sub
    Private Sub MyButtonClickEventHandler(ByVal sender As Object, ByVal e As EventArgs)
        mrButton.Text = "You clicked me!"
    End Sub
End Class

© Stack Overflow or respective owner

Related posts about vb.net

Related posts about visual-studio-2010