Share via


table layout panel column size problem

Question

Tuesday, February 26, 2013 5:45 PM

I have a table layout panel that is not docked, its autosize property is set to false, and the columns have absolute sizes specified, but whenever I Close and open the form, the last column grows off the form, hiding most of its content.  The form is not sized anywhere in code.  Does anyone know why this might be?

Thanks,
Corey Furman @ Facebook
______________________________________________________
Please mark posts as answer or helpful when they are.

All replies (8)

Thursday, March 7, 2013 3:42 AM âś…Answered

Hi Corey,

Thanks for your full cooperation to send the sample.

I did reproduce the issue. Then I found there were several bug reports/feedbacks related to the last column. However, unfortunately, I found the issue was marked as "by design" and we do have workaround for this.

To workaround this issue, we need to anchor each child control in each cell Left + Right to fit the cell.

Sorry for any inconvenience the issue bring to you. And thanks for you feedback!

Thanks,

Alan Yao [MSFT]
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help.


Wednesday, February 27, 2013 9:10 AM

Hi Corey,

What's the difference between original form and the reopen form? Are there some columns' width changed? 

Thanks,

Shanks Zen
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help.


Wednesday, February 27, 2013 12:20 PM

There isn't anything different.  I have further details discovered after I posted: oddly, I see this behavior in the designer.  I open the editor for the columns and rows, select the column, set its absolute size to 91 and click save.  It takes it, and the tlp looks right in the designer.  If I close the form editor and reopen it, the column reverts to an absolute size of 110.  If I run the application before I open the form editor, the application looks correct at runtime.  If I run it after opening the form editor, it displays the incorrect column width.

Other notes: the tlp has an AutoSize set to false, an AutoSize mode of GrowOnly, and a GrowStyle of FixedSize.  All child controls in that column are aligned top, left, dock = Full, and margins of 3.

Thanks,
Corey Furman @ Facebook
______________________________________________________
Please mark posts as answer or helpful when they are.


Friday, March 1, 2013 10:01 AM

Hi Corey,

I will involve some experts into this case.

Thanks,

Shanks Zen
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help.


Tuesday, March 5, 2013 3:40 AM

Hi Corey,

I tried to reproduce the issue you reported, but I cannot get the issue repro. Could you please create a simple project and let me know the steps to reproduce the issue?

Please email the sample(in zip format) to me(ALANYAO AT MICROSOFT.COM).

Thanks,

Alan Yao [MSFT]
MSDN Community Support | Feedback to us
Develop and promote your apps in Windows Store
Please remember to mark the replies as answers if they help and unmark them if they provide no help.


Tuesday, March 5, 2013 5:48 PM

I can probably do that, but you might be able to reproduce it with further info that I have found/noticed.  There are four columns in the table layout, and the first column was set to autosize.  I had a label control in that column with dock=fill.  The text property of that label just fit, but maybe with margins it was trying to push the column size out, and it didn't try to reapply an autosize to the column upon opening the form in the designer.

Thanks,
Corey Furman @ Facebook
______________________________________________________
Please mark posts as answer or helpful when they are.


Thursday, March 7, 2013 3:43 AM

Good enough, thanks for your time.

Thanks,
Corey Furman @ Facebook
______________________________________________________
Please mark posts as answer or helpful when they are.


Friday, July 25, 2014 4:07 PM

Hi

I'm having the same problem.  Even though all rows/columns are setup for equal percentages the last column and row can sometimes be bigger depending on the main window size that the panel is anchors too (mine is Top, Bottom, Left, Right). I've created the columns/rows in designer and even there they show with the last column/row slightly expanded.

My controls are added programmatically though and even though i'm anchoring as you suggest it makes no difference. Can you explain a bit more if there are extra steps to do?

Also is it possible for the first row/column (typically the col/row header labels) to take up the slack somehow?

Is any on this to do with the fact that percentages are only to 2 decimal places in the designer even though they are stored as single?

Would appreciate some guidance.

Regards

Julian Wigman