Click here to Skip to main content
15,887,596 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I created a user control and for some reason, I include a second user control in it. during the test in the user control test container, it works well but when I add it in the main program form the second user control disappeared.
Does anybody have the same experience? How can I eleminate this problem?

What I have tried:

The second user control is enabled and visible. I tried Show and BringToFront also but the problem exists.
Posted
Updated 16-Apr-22 19:51pm
Comments
Dave Kreskowiak 16-Apr-22 21:00pm    
"Can UserControls contain other UserControls?" Yes.

How to fix your's? It's impossible to tell because nobody can see your code since you didn't post it here. Click the "Improve question" link and add your code.

1 solution

Without your code, we can't be specific or fix your problem.
But, yes, a UserControl can contain other UserControls, just as they can contain "standard" controls - I do it regularly.

So the first thing to do is to gather information: create a new form, add the "inner control" directly to it, and display the form. What do you see?
If that works, add the "outer control" to the new form, and display that as well. What do you see?
Then add a "standard control" to the outer control and display the new form. What do you see?

This is a process of "narrowing down" where the problem occurs. If you think about what you see, it should start to be clearer where the problem is. And then you can start working out how to fix it!
 
Share this answer
 
Comments
Member 12687352 18-Apr-22 2:20am    
Thanks for your reply and information.

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