简体   繁体   中英

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 :)

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

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. Eg by setting the TAG property with an arbitrary value. Then you can delete the controls that have a specific TAG property later.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM