Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Container Padding Ignored
Message
From
01/09/2008 17:24:24
 
 
To
29/08/2008 07:43:58
General information
Forum:
ASP.NET
Category:
Forms
Environment versions
Environment:
C# 2.0
OS:
Windows XP SP2
Network:
Windows 2003 Server
Miscellaneous
Thread ID:
01342302
Message ID:
01343914
Views:
15
Hey Bill,

It seems that it respects the padding correctly when you dock or anchor the control.

~~Bonnie




>Agreed. My tests indicate that ( at least for me ) a container ( e.g. Panel, GroupBox ) just ignores the Padding settings. I.e. you can set the Padding to 20 for all sides and then place a control at the edge of the contaner ( e.g. Top = 0, Left = 0 ) "inside" the padding. In this case what's the point of the Padding property. To me, settings of Top = 0 and Left = 0 with a Padding set to 20 should place the control at a position of 20 pixels away from the edges of the control's borders. Or else, I don't understand the concept of Padding ( which is also possible for a KISS type of person like me ). Yes, "arrgghh" is the operative word for things like this.
>
>>Hey Bill,
>>
>>I hear that. There's a lot left to be desired in .Net webform layout; in fact, often I look at width and height values that make no sense in the actual layout. Sometimes I just ignore the values when it looks OK at runtime. Arrgghh
>>
>>
>>>
>>>You mean check to make sure that it is sufficiently wide to hold the controls? I will look at this, but I have been using AutoSize = true so I "assume" that the (GroupBox) control would appropriately resize itself to accommodate the controls as they are added. Currently I am just manually putting in marginal spacing to get the look and feel correct ... very irritating.
>>>
>>>Bill
>>>
>>>>Check the Width of the Groupbox. Control width has been my promary problem with getting containers to behave well.
>>>>
>>>>>Has anyone seen conditions under which the Padding property of a container is ignored?
>>>>>
>>>>>I have a scenario in which I Programmatically create a TableLayoutPanel and programmatically populate it with controls. A GroupBox is programmatically created and the TableLayoutPanel programmatically added to it. The GroupBox is then programmatically added to an existing Panel control. I can programmatically set the Padding on the GroupBox control and set the Padding on the existing Panel control in the IDE. However, the controls that are added to these container controls are still butted up against the absoulte borders of the containers, which seems to indicate that the Padding property is being ignored for the containers.
>>>>>
>>>>>Has anyone seen this or am I missing something here?
>>>>>
>>>>>Thanks,
>>>>>Bill
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform