DELETE DYNAMIC BUTTON

Jaya J

Total Post:9

Points:63
Posted by  Jaya J
C# 
 943  View(s)
Ratings:
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.


  1. Manoj Pandey

    Post:26

    Points:188
    Re: Delete dynamic Button

       

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

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!