在Windows窗体中使用TableLayoutPanel.我正在使用RowStyles和ColumnStyles,SizeType分别为AutoSize和Percent.我需要找出放置特定控件的单元格的绝对高度和宽度.
TableLayoutPanelCellPosition pos = tableLayoutPanel1.GetCellPosition(button1);
int height = (int)tableLayoutPanel1.RowStyles[pos.Row].Height;
int width = (int)tableLayoutPanel1.ColumnStyles[pos.Column].Width;
上面,我的高度为0. RowStyle的SizeType为AutoSize.同样,我得到了33.33.ColumnStyle设置为SizeType为Percent,Size = 33.33.
我需要获得单元格的绝对大小(以像素为单位).