Windows Develop Bookmark and Share   
 index > Windows Forms Designer > Paste with default size?
 

Paste with default size?

Actually i was refer your example in MSDN article in March 2006 "Create And Host Custom Designer with The .NET 2.0 Framework" (http://msdn.microsoft.com/en-us/magazine/cc163634.aspx). I am using DesignSurface object to create a Form designer. When I copy a resized control and paste it, it paste's it with the default size. Anyone out there manage to solve this problem? Please send me a sample if you can.

We Kwang  Friday, August 21, 2009 9:40 AM

Please refer to the following article:

How to Clone/Serialize/Copy & Paste a Windows Forms Control

http://www.codeproject.com/KB/miscctrl/ControlCloneTst.aspx

It uses clipboard to keep the control. Use reflection to create the new control. Then get the old control property and set to the new control.

Best regards,

Ling Wang


Please remember to click “Mark as Answer�on the post that helps you, and to click “Unmark as Answer�if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Ling Wang  Friday, August 28, 2009 9:28 AM
Hi Ling Wang,
Thank you for your solution. Yes, i will try to implement the solution you suggested. Thank you so much.
  • Marked As Answer byWe Kwang Tuesday, September 01, 2009 2:24 AM
  •  
We Kwang  Tuesday, September 01, 2009 2:24 AM

Please refer to the following article:

How to Clone/Serialize/Copy & Paste a Windows Forms Control

http://www.codeproject.com/KB/miscctrl/ControlCloneTst.aspx

It uses clipboard to keep the control. Use reflection to create the new control. Then get the old control property and set to the new control.

Best regards,

Ling Wang


Please remember to click “Mark as Answer�on the post that helps you, and to click “Unmark as Answer�if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
Ling Wang  Friday, August 28, 2009 9:28 AM
Hi Ling Wang,
Thank you for your solution. Yes, i will try to implement the solution you suggested. Thank you so much.
  • Marked As Answer byWe Kwang Tuesday, September 01, 2009 2:24 AM
  •  
We Kwang  Tuesday, September 01, 2009 2:24 AM

You can use google to search for other answers

Custom Search

More Threads

• Thread Safe Controls
• In VS2008 the designer loses panels order when inheriting from a UserControl
• Multiple [Modifiers] property is added to each component in design time when rebuilding projectsâ€
• how to handle Events of user control?
• how to create and access data from resource files
• Forms crashing on open? Guard your timers.
• How to show the progress in percentage over a progress bar
• DLU vs Pixels
• Web Browser control issue
• Smart tags not show for custom control designer