Home > DeveloperSection > Forums > Delete dynamic Button
Jaya J
Jaya J

Total Post:9

Points:63
Posted on    April-17-2015 12:07 AM

 .NET C# 
Ratings:


 1 Reply(s)
 609  View(s)
Rate this:
I write code for dynamic button creation based on user choice at different locations in windows form.
Suppose i created 15 buttons dynamically like Btn1,Btn2,...Btn15 in different locations.Now i want to delete Btn5 from that location.Is it possible to delete?If possible tell me the code for this?
Please Anybody help me.

Thanks.




Manoj Pandey

Total Post:26

Points:188
Posted on    April-17-2015 6:51 AM

   
Yes it is possible. You can remove button dynamically. Use below code
frm.Controls.Remove(button1);
 frm is your form object 

Don't want to miss updates? Please click the below button!

Follow MindStick