Click here to Skip to main content
15,912,977 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi. I have a problem on the user control. My user control is movable, but most frequently, when I move the user control to other place inside the form, my user control disappear. My User control is flickering. And it exceeds within the boundary of the form. Meaning, I wasn't able to view some of it because it moves/exceeds to the boundary of the form. :)
Posted

Without seeing code I would guess you are having docking issues.

There are several reasons for your problem,
this.Controls.Add(usercontrol1) may need addressing.

Here[^] is a MS link.

And Here[^] is c#Corner link.

I hope they help.

If not, please supply more information.
 
Share this answer
 
Comments
yummy02 15-Jan-11 2:47am    
Thanks.. :)
When you move it, do you do so from within the control, or from the form?

If the former (i.e. this.Location = new Point(x,y);) then you will need to have some way to pass the limits of it's movement through from the form. Remember that the form can be re-sized, and so the control limits are changeable.

If the latter (i.e. myControl.Locaion = new Point(x, y);) then you need to check before you set the location, and ensure it is within the body of the form.

Sorry if that seems obvious, but that's the way it goes. If you don't check limits and allow for them, then it ain't going to work correctly!
 
Share this answer
 
Comments
Espen Harlinn 14-Jan-11 5:01am    
5+ the obvious, isn't allways so obvious :) good answer
yummy02 15-Jan-11 2:47am    
Thanks.. :)
Here is one solution:
User-driven applications[^]

It has the required functionality, and then some :)

Regards
Espen Harlinn
 
Share this answer
 
Comments
yummy02 15-Jan-11 2:47am    
Thanks.. :)

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