How to use control collection
-
I would like to use control collection Method to clear the values of text box through one code is it possible
Hi, See if you can adapt this piece of code to your needs:
Private Function ButtonLock(ByVal key As Boolean) Try Dim Ctrl As Control For Each Ctrl In Controls If TypeOf Ctrl Is Button Or TypeOf Ctrl Is ComboBox Then Ctrl.Enabled = key End If Next Catch Ex As Exception msgbox(Ex.message) End Try End Function
Hope it helps, Johan -
I would like to use control collection Method to clear the values of text box through one code is it possible
If you have a collection of TextBoxes you can do this
For Each tb As TextBox In CollectionName tb.Text = Nothing Next
Jonathan Sampson www.SampsonResume.com
-
Hi, See if you can adapt this piece of code to your needs:
Private Function ButtonLock(ByVal key As Boolean) Try Dim Ctrl As Control For Each Ctrl In Controls If TypeOf Ctrl Is Button Or TypeOf Ctrl Is ComboBox Then Ctrl.Enabled = key End If Next Catch Ex As Exception msgbox(Ex.message) End Try End Function
Hope it helps, Johan