Click to See Complete Forum and Search --> : user-defined controls


simon29
May 6th, 2003, 03:25 AM
Hi!
I have create my own control in C#. When I try to use it on my WIndows Form I get an HRESULT exception and the control is never created. Anyone knows how can I debbug this in order to detect the error???

Thanks in advance!

pareshgh
May 6th, 2003, 12:42 PM
you must be initiallizing some thing on creation. note when u create an instance by draging the new instance is created and thus it executes the controls' initialize, contructor, load events. so what u should do is have a Init() or your load type method which will actually do the loading. you might be doing some database stuff or some kind of loading which can be done only at run time. so eventually when u create an instance its somewhat runtime only in the essence that it execute some code of the User control.

-PAresh