Windows Develop Bookmark and Share   
 index > Windows Forms Designer > Winforms controls get dislocated
 

Winforms controls get dislocated

Hi,
I am using a tabcontrol and there is a user control hosted along with other controls. Once oI run the application the controls in the form in design view get dislocated. The controls are moved to location which is outside the bounds of the form.

The controls are displayed on the form perfectly. The problem is only in the design view. The controls are locked as well.

This thing is bugging me from past 2 days. Please help. I am working on VS 2008 Team system winforms.


Ravi
Ravimama  Monday, December 22, 2008 5:50 AM

Hi Ravimama,

Base on my understanding, when you open the form in VS designer, a user control hosted in TabControl cannot shown correctly, but it does shown correctly in run time. Am I right?

It seems the user control in another assembly cannot be loaded correctly in design time and cause the problem. Please try to keep that user control opened in the designer when you open the form. This can ensure the VS designer load the user control from the assembly correctly.

Please tell me if it helps.

Sincerely,
Kira Qian


Please mark the replies as answers if they help and unmark if they don't.
Kira Qian  Tuesday, December 23, 2008 9:09 AM

We are changing the issue type to “Comment�because you have not followed up with the necessary information. If you have more time to look at the issue and provide more information, please feel free to change the issue type back to “Question�by editing your initial post and changing the radio button at the top of the post editor window. If the issue is resolved, we will appreciate it if you can share the solution so that the answer can be found and used by other community members having similar questions.

Thank you!

Best Regards

Kira Qian
Please mark the replies as answers if they help and unmark if they don't.
Kira Qian  Friday, December 26, 2008 2:45 AM
Hello all,

I'm running into the same problem or at least a very similar one. I too have a custom control (a group box specifically) which is placed inside the standard WinForms tab control. The application looks fine when it runs. All of the controls are where they should be. The problem arises when the Visual Studio 2008 WinForms designer needs to reload. When it reloads all of the controls in the group box get moved around to completely non sensical locations. Some are far off the screen. When I run the application again after the controls have been relocated, the application looks the same as it does in the design view (the controls are in the wrong location). The only way to get things back to the proper state is to move them back manually. This is getting to be a more arduous process as the application grows and it's gotten to the point where development is becoming very unproductive.

I've tried most everything I can think of at this point. I've cleaned/rebuilt a thousand or so times. I've built a completely new Visual Studio project. I reverted back to a Visual Studio 2005 project but even that didn't work. It's all completely strange to me as we've used the group boxes in question in virtually every WinForms project our company has ever done. They've always worked, in a tab control too.

This was my first project with Visual Studio 2008 so I'm wondering if the install has messed something up. Like I said, 2005 doesn't seem to work correctly either now.

I would very much appreciate some help on this issue.

Justin
Noxage  Tuesday, February 03, 2009 2:41 PM

You can use google to search for other answers

Custom Search

More Threads

• Labels Arghhhhhhhhhhh
• Problem Updating .resx file
• Problem drawing custom object when hidden by windwo, then redrawing.
• Changing width of left side list in collection editor
• Is it possible to hide third column if two columns are assigned to a ListView control ?
• Control Name property
• Why is a hashtable needed in Dinesh Chandnani's sample XmlDesignerLoader
• Creating own dynamic forms designer...
• Designers and Abstract Classes
• UserControl in a DataGridView / DataGridViewCell