Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

i'm not lazy i'm just resting before i get tired.
  • Administrators
Posted

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.

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Posted

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

i'm not lazy i'm just resting before i get tired.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...