Thursday, December 15, 2011

Button Play

1.A program that will initially display two buttons, the first is enabled and the other is disabled. The behavior will be, once you click the Enabled button, it will be disabled, while the other button (which is disabled) will be enabled.



2. CODE:


Public Class frmButtonPlay

Private Sub btn1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn1.Click

btn1.Enabled = False
btn2.Enabled = True
End Sub


Private Sub btn2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btn2.Click

btn2.Enabled = False
btn1.Enabled = True
End Sub

Private Sub backtoindex_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles backtoindex.Click

Me.Close()
End Sub

Private Sub frm2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

btn1.Enabled = True
btn2.Enabled = False
End Sub

End Class

3. Save & Run...

No comments:

Post a Comment