Click here to Skip to main content
15,915,094 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi ,

how can i remove buttons dynamically?
Posted
Comments
Rajesh Anuhya 26-Dec-11 4:59am    
Not clear

Try this url....................Dynamically add and remove user controls[^]
 
Share this answer
 
hi u can set button as visible=false
like
C#
button1.Visible = false;
and if u want set that place any other control using of X and Y coordinate values.
 
Share this answer
 
v3
Comments
RaisKazi 26-Dec-11 5:10am    
Edited: Added "pre" and "code" tags.
arielb 26-Dec-11 13:58pm    
that will remove them from the view of course, but will keep them in memory.
he shouldnt use that if he wants to remove them for good.
RaisKazi 27-Dec-11 1:39am    
I think you might intended this comments to the solution provider.
when you want to hide the button dynamically. Means is there any condition that you are applying and on the result of that you want to remove the button.
you cant remove just hide the button. on particular event you can call the button using id and set visible false like jasminpatel has said in the answer. for more details go through this :
http://msdn.microsoft.com/en-us/library/microsoft.office.tools.excel.controls.button.visible%28v=vs.80%29.aspx[^]
 
Share this answer
 
C#
Button id.visible="false"

then you can do that
 
Share this answer
 
v2
you can do it two way:

1)
button.visible ="false";

2)

button.Style.Add("display", "none");
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900