Windows Develop Bookmark and Share   
 index > Windows Forms Designer > Custom control designer cut & paste or move no InitializeNewComponent
 

Custom control designer cut & paste or move no InitializeNewComponent

Hi everyone,

I have a custom control with a custom designer. I need to check something about the control when it gets added to its parent. Currently I override InitializeNewComponent and perform the checking there. The problem is when I cut and paste the control onto another parent it does not seem to run either InitializeNewComponent nor InitializeExistingComponent. Is there any method that does run and a way to know that a cut and paste was performed?

Regards,

Mark.

spanky4_3  Wednesday, August 27, 2008 6:40 AM

Hi spanky4_3

I have tested and recurred your issue, neither InitializeNewComponent nor InitializeExistingComponent would occur when you copy or cut your component to another form. If you do like to implement this effect. You should override the Initialize method. It will be called once the component be copied or cut to another form. As far as I know this is the only way.

If you have any question, please don’t hesitate to tell me.

Sincerely,

Kira Qian

Windows Forms General FAQs
Windows Forms Data Controls and Databinding FAQs

Kira Qian  Monday, September 01, 2008 6:49 AM

Hi spanky4_3

I have tested and recurred your issue, neither InitializeNewComponent nor InitializeExistingComponent would occur when you copy or cut your component to another form. If you do like to implement this effect. You should override the Initialize method. It will be called once the component be copied or cut to another form. As far as I know this is the only way.

If you have any question, please don’t hesitate to tell me.

Sincerely,

Kira Qian

Windows Forms General FAQs
Windows Forms Data Controls and Databinding FAQs

Kira Qian  Monday, September 01, 2008 6:49 AM

You can use google to search for other answers

Custom Search

More Threads

• Right menu in my computer window??
• UserControl basics
• not a legal form error in windows designer
• Documentation / detailed explanation for InitializeComponent
• Automatic resize of Controls based on display resolution
• Multi select drop down and data binding
• Nullreference exception in VS2008 designer
• How to SetCompatibleTextRenderingDefault at Design Time (C#)
• How to design an irregular shape button??
• CodeDomDesignerLoader can't produce own Form.Running Error