Click here to Skip to main content
15,908,173 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Please help me to create the Button dynamically....for example we cannot show the button in the design page but it will be show in the run time using Windows Form...
Posted
Updated 4-Nov-11 23:43pm
v2
Comments
Mehdi Gholam 5-Nov-11 5:40am    
What technology WinForm, Web, WPF?
Sam Path 5-Nov-11 5:41am    
WinForm tech...

have a look at the following example, this might help you:
C#
Button button1 = new Button();
button1.Location = new Point(20,10);
button1.Text = "Click Me";
// adding to groupBox1
groupBox1.Controls.Add(button1);
 
Share this answer
 
Comments
Sam Path 5-Nov-11 5:55am    
Method for groupBox1..
Refer this link

Dynamically created button in asp.net and c#[^]

May give you some idea
 
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