Click here to Skip to main content
15,902,870 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all I create application with some forms i have button in one form of this i want in run time copy control of this button in the second form without create it again. For example , i have X button in form 1 in run time i want to create a copy of this button in form 2 with all properties it's have in form 1. This an example for one button i have
To avoid write his code again help please?

C#
<Button Content="Open Window" Click="ButtonClicked" Height="25"
HorizontalAlignment="Left" Margin="379,264,0,0" Name="button1" 
VerticalAlignment="Top" Width="100" />
Posted

1 solution

Create multiple instaces of this form.
For e.g.
Form1 frm1 = new Form1();
Form1 frm2 = new Form1();
 
Share this answer
 
Comments
ahmedfcih 22-Feb-14 6:01am    
i need this button only ? so i will make an object from it ?

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