Re: user control elements completely displaced when control is used on windows form

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



Hi Linda,

thanks for your reply. I neither used FlowLayoutPanel nor TableLayoutPanel. I got a single main form which was kind of a "rapid prototype" and just continued on it. I will just sketch hierarchically how I began:

*GroupBox
+GroupBox
-Combobox (4x)
-Label (8x)
+ComboBox
-TextBox (4x)
-Label (8x)
+Button (9x)
*GroupBox
+TabControl
-UserControl (dynamically added)

and so on. Other controls used within group boxes:

-ProgressBar
-RadioButtons

Now I have to reuse the first group:

*GroupBox
+GroupBox
-Combobox (4x)
-Label (8x)
+ComboBox
-TextBox (4x)
-Label (8x)
+Button (9x)

I just created a new user control and did a copy-and-paste. The arrangement was perfectly the same in the designer view on the control.
After dragging the user control back to the main form it was bigger and the group boxes, buttons, etc. were displaced.

Thanks in advance for your answer.

regards

Fabian

Linda Liu [MSFT] schrieb:
Hi Fabian,

Do you create your project in VS 2005? If yes, do you use FlowLayoutPanel or TableLayoutPanel on the UserControl?

If you use FlowLayoutPanel or TableLayoutPanel on the UserControl and set its Dock property to Fill , when you put the UserControl onto the form and resize the UserControl or dock it to a border of the form, the layout of the UserControl is rearranged.

If you have used FlowLayoutPanel or TableLayoutPanel on the UserControl, I recommend you to set its Dock property to None.

If you haven't used FlowLayoutPanel or TableLayoutPanel on the UserControl, would you tell me what controls other than lable, textbox and button you have put on the UserControl?

I look forward to your reply.


Sincerely,
Linda Liu
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
Note: The MSDN Managed Newsgroup support offering is for non-urgent issues where an initial response from the community or a Microsoft Support Engineer within 1 business day is acceptable. Please note that each follow up response may take approximately 2 business days as the support professional working with you may need further investigation to reach the most efficient resolution. The offering is not appropriate for situations that require urgent, real-time or phone-based interactions or complex project analysis and dump analysis issues. Issues of this nature are best handled working with a dedicated Microsoft Support Engineer by contacting Microsoft Customer Support Services (CSS) at http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

.



Relevant Pages

  • RE: user control elements completely displaced when control is used on windows form
    ... If you use FlowLayoutPanel or TableLayoutPanel on the UserControl and set ... Microsoft Online Community Support ...
    (microsoft.public.dotnet.framework.windowsforms)
  • TableLayoutPanel, tabbing
    ... I'm building a UserControl around the TableLayoutPanel. ... As the user tabs out of a control at the bottom of the one column the cursor ... Basically each data entry control will be the same width so in effect you'd ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Re: FlowLayoutPanel : cant add UserControls in code ?
    ... I meant to say that by bracketing the code that instantiates the UserControl ... I can make the control be visible inside the FlowLayoutPanel. ...
    (microsoft.public.dotnet.framework.windowsforms.controls)
  • Re: Location
    ... Servus, Alda... ... einem Fenster an die Größe des Fensters anpassen". ... TableLayoutPanel: ... FlowLayoutPanel: ...
    (microsoft.public.de.german.entwickler.dotnet.csharp)
  • Re: FlowLayoutPanel : cant add UserControls in code ?
    ... they are not "flowing" as they should from top to bottom. ... > Experimenting with the FlowLayoutPanel and adding UserControls that I wish ... > Tried calling .Show on the UserControl and Refresh on the FlowLayoutPanel, ... > thanks, Bill Woodruff ...
    (microsoft.public.dotnet.framework.windowsforms.controls)