In Visual Basic, create the interface which is shown below. The user can disable or enable the textbox by clicking on the appropriate button. After the user clicks the Enable button, the text box should receive the focus.
Suggested Control Names and Attributes:
Name Property | Text Property | Control Type | Notes |
frmTextBox | Text Box | Form | Holds Controls |
txtBox | Text Box | Blank text box | |
btnDisable | Disable Text Box | Button | Disables the text box. |
btnEnable | Enable Text Box | Buton | Enables the text box. |
Write the Code:
' Project: Text Box ' Programmer: Your Name Here ' Date: January 27, 2014 ' Description: Creates a text box and two buttons which enable or disable the text box. Public Class frmTextBox Private Sub btnDisable_Click(sender As Object, e As EventArgs) Handles btnDisable.Click txtTextBox.Enabled = False End Sub Private Sub btnEnable_Click(sender As Object, e As EventArgs) Handles btnEnable.Click txtTextBox.Enabled = True End Sub End Class