Click here to Skip to main content
15,902,032 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
how do i copy the controls of one form to another?
Posted
Comments
CHill60 29-May-15 6:02am    
At design time? At runtime?
ZurdoDev 29-May-15 13:36pm    
Microsoft actually has a document on how to do it at design time, in case someone's never used a computer before.

https://msdn.microsoft.com/en-us/library/8c4dde5h%28v=vs.90%29.aspx

:)
CHill60 30-May-15 0:27am    
:) *deleted what *I* thought was a humorous comment..
Virtual +5 BTW
Member 11521909 29-May-15 6:10am    
RUNTIME
[no name] 29-May-15 6:20am    
You don't. WPF doesn't have "forms", it has windows. If you really think you have to do something like this, create a user control.

1 solution

You would need to iterate through the Forms controls collection, https://msdn.microsoft.com/en-us/library/system.windows.forms.control.controls(v=vs.110).aspx[^] and then start creating and adding new controls to the new form.

I suggest you find a different way to accomplish what you need.
 
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