Ehsank
Ehsank

Reputation: 173

tabpage controls

Is there any way to delete the controls on a tab-page that i have added on runtime ? Plz remember only to delete runtime added controls (C#) ?

Thanks a lot :)

Upvotes: 0

Views: 757

Answers (2)

testalino
testalino

Reputation: 5678

You need to either remember the name of the controls that were not added at runtime or you "flag" those that are added at runtime. E.g. by setting the TAG property with an arbitrary value. Then you can delete the controls that have a specific TAG property later.

Upvotes: 1

Vyasdev Meledath
Vyasdev Meledath

Reputation: 9016

Add controls with unique name and delete controls whenever you want.

Eg:

 tabControl1.TabPages["tb1"].Controls.Remove("txtName");

NOTE:Control name txtName should be unique

Upvotes: 1

Related Questions