Hi,
I am setting all the textbox controls on a form to read only.
Then when the user clicks on a button I want to change all the textbox back to being editable!
Heres my code but it doesnt work or produce any errors. There are 7 textboxes on my form.
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
'...Allow user to add and edit records...
For Each ctrl As Control In Me.Controls
If TypeOf ctrl Is TextBox Then
Dim txt As TextBox = CType(ctrl, TextBox)
txt.ReadOnly = False
MsgBox(txt.Name.ToString)
End If
Any help appreciated.
I am setting all the textbox controls on a form to read only.
Then when the user clicks on a button I want to change all the textbox back to being editable!
Heres my code but it doesnt work or produce any errors. There are 7 textboxes on my form.
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
'...Allow user to add and edit records...
For Each ctrl As Control In Me.Controls
If TypeOf ctrl Is TextBox Then
Dim txt As TextBox = CType(ctrl, TextBox)
txt.ReadOnly = False
MsgBox(txt.Name.ToString)
End If
Any help appreciated.