R
Ralph Wiggum
I have created a control in C# and it works a treat, however, when I
drop the control into a C# Windows Forms application, it does a very
odd thing. It creates the control in design mode, but when I run the
application, the control is nowhere to be seen.
Looking at the form designer generated code in the InitializeComponent
function, it has not added the code to create a instance of my
control.
ie. this.MyControl= new MyControl();
it has however, created the code in InitializeComponent() to add it to
the form...
Other controls I have created work fine, it's just this one, so I
think there is something wrong with my control, but having been
tearing my hair out all morning, and trying everything I know (which
is not alot..), I am still no further down the road to solving
this....
PS. If I add the code to create a new instance, then it works, until I
change somehting on the form, it then disappears.
Anyone got any ideas?
drop the control into a C# Windows Forms application, it does a very
odd thing. It creates the control in design mode, but when I run the
application, the control is nowhere to be seen.
Looking at the form designer generated code in the InitializeComponent
function, it has not added the code to create a instance of my
control.
ie. this.MyControl= new MyControl();
it has however, created the code in InitializeComponent() to add it to
the form...
Other controls I have created work fine, it's just this one, so I
think there is something wrong with my control, but having been
tearing my hair out all morning, and trying everything I know (which
is not alot..), I am still no further down the road to solving
this....
PS. If I add the code to create a new instance, then it works, until I
change somehting on the form, it then disappears.
Anyone got any ideas?