bpayne111 Posted November 23, 2003 Posted November 23, 2003 I'm 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 Quote i'm not lazy i'm just resting before i get tired.
Administrators PlausiblyDamp Posted November 23, 2003 Administrators Posted November 23, 2003 Overloading a form's constructor is perfectly fine. Overloading a usercontrol's 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. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
bpayne111 Posted November 24, 2003 Author Posted November 24, 2003 how do you do this in c#? i tried doing it the normal way i'd overload a method and it didn't 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 Quote i'm not lazy i'm just resting before i get tired.
Administrators PlausiblyDamp Posted November 24, 2003 Administrators Posted November 24, 2003 You would overload the form's constructor just like a normal class. What code are you using in the form and how were you trying to instantiate it? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.