Overload constructor for UserControl

bpayne111

Well-known member
Joined
Feb 28, 2003
Messages
326
Location
BFE
Im having some trouble with an app and one way of solving my problem would be overloading the constructor of my user control or a windows form. I have a feeling neither of these is possible am i correct?

brandon
 
Overloading a forms constructor is perfectly fine.
Overloading a usercontrols constructor can be done but the design time creation of controls only uses the default constructor - you will either have to manually create the control in code or go in and edit the designer generated code to use the overloaded constructor.
 
how do you do this in c#? i tried doing it the normal way id overload a method and it didnt seem to work.
when i declared a new form using my overloaded constructor it gave me a "No constuctor accepts this number of arguments" error" or something to that nature. I rebuilt my project too, to be sure that it would find it.
Am i missing something here?

thanks
brandon
 
You would overload the forms constructor just like a normal class.

What code are you using in the form and how were you trying to instantiate it?
 
Back
Top