Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.
public partial class UserControl1 : UserControl
{
//this is the contructor, without parameters;
public UserControl1()
{
InitializeComponent();
}
public UserControl1(int field)
{
InitializeComponent();
//do something with your field
}
public UserControl1(string field)
{
InitializeComponent();
//do something with your field
}
}
all the anteriors are overloadings, constructor without parameter, constructor with one integer parameter, constructor with string parameter...all are valid because you can use overloading with variations in amount of parameters and tipe of them
UserControl1 x = new UserControl1(ParameterA,ParameterB,ParameterC)
can you post your code, or explain more clearly
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.