Windows Develop Bookmark and Share   
 index > Windows Forms General > Wrapping label in TableLayoutPanel
 

Wrapping label in TableLayoutPanel

I am trying to get a Label control to wrap--the control is placed within a cell of a TableLayoutPanel and its AutoSize property is set to true. As the TableLayoutPanel cell is set to a % the Label should wrap, but it doesn't. Any ideas?
Larkin Y  Wednesday, December 21, 2005 12:26 AM

I was having problems getting my labels to wrap - you solved the other half of the problem. I didn't realize I needed a percent column - 100% worked great with the other columns set to "autosize".

The two things I would check in addition to "AutoSize=true" is that the labels have a FlatStyle of Standard and that Anchor is "Top, Left, Right". The right anchor is looked at by the TableLayoutPanel to determine where it should wrap, AFAIK.

Hope that helps!

ShadowChaser  Wednesday, February 22, 2006 8:43 PM

I was having problems getting my labels to wrap - you solved the other half of the problem. I didn't realize I needed a percent column - 100% worked great with the other columns set to "autosize".

The two things I would check in addition to "AutoSize=true" is that the labels have a FlatStyle of Standard and that Anchor is "Top, Left, Right". The right anchor is looked at by the TableLayoutPanel to determine where it should wrap, AFAIK.

Hope that helps!

ShadowChaser  Wednesday, February 22, 2006 8:43 PM

You can use google to search for other answers

Custom Search

More Threads

• TreeView Events Not Firing
• WM_GETTEXT Usage
• How to Access Controls On Different From
• FormBorderStyle.None and taskbar
• Problem with auto resized comb box and disapperd scroll bar.
• Resources use.
• Save in treeView1, Load from treeView1
• Multi-dimensional array property
• dgv.EndEdit() in dgv.CellLeave event causing exception
• Calender control businness logic