Click here to Skip to main content
15,885,366 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi guys,,, i created a user control form in WINDOWS FORM CONTROL library, designed and coded... executing exactly how i want....
but i want the output in windows form... so i opened a windows form and drag and dropped this usercontrol into the form,... there i got a break... no when i want to execute, the output is coming in user control test container....

what code should i have to write to execute the user control in windowsform....?
Posted

1 solution

That isn't a question we can answer: it's usually a problem with the default constructor of your UserControl.

So remove the instance you dropped on the form, and add an instance programmatically, on a button click:
C#
private void butTestUserControl_Click(object sender, EventArgs e)
    {
    MyUserControl uc = new MyUserControl();
    Controls.Add(uc);
    }
Then put a breakpoint on the first line and step into the constructor: follow the code through and look for where the problem is.

Sorry, but we can't do that for you!
 
Share this answer
 
Comments
chaitanya556 24-Jun-14 2:50am    
even though i cant get my desired result...

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900