Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Clear databinding from multiple text boxes

Status
Not open for further replies.

tman72

Technical User
Jan 22, 2003
116
0
0
US
Hello,

I have a form with multiple text boxes that are databound. Instead of clearing the databinding from each text box one at a time is there a way to loop through each text box and remove the databinding? It seems silly that I would have to go through like this:

txtItem.DataBindings.Clear()
txtItemID.Databindings.clear()

If this is the only way to go about it, I can do it this way, but it seems like there must be a better way to remove the databinding from several text boxes than the above psuedo code.

Any help is greatly appreciated.

Thanks.
 
Nevermind...I should have had my morning coffee earlier then I would have realized to do this...

Dim ctl as Control
For each ctl In Me.Controls
If TypeOf ctl Is TextBox Then
ctl.DataBindings.Clear()
End If
Next

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top