1
userControl (DockStyle.Fill)을 채우는 TableLayoutPanel에 문제가 있습니다. 이 컨트롤을 크기를 조정할 때 문제가 생기면 모든 셀의 크기를 변경해야하지만 마지막 행과 마지막 열만 크기가 바뀝니다 (전체 tableLayoutPanel이 컨트롤을 채 웁니다). Bounds 속성을 사용하여이 조절기 크기를 변경합니다.스케일링 WinForms TableLayoutPanel
의 내가 다음 코드를 쓴 가정 해 봅시다 : 어떤 도움
// creating tableLayoutPanel:
private void createTableLayoutPanel(int count)
{
tableLayoutPanel = new TableLayoutPanel();
tableLayoutPanel.MouseClick += new MouseEventHandler(this.observe_MouseClick);
tableLayoutPanel.AutoSize = true;
tableLayoutPanel.ColumnCount = 3;
tableLayoutPanel.RowCount = count;
tableLayoutPanel.Dock = DockStyle.Fill;
tableLayoutPanel.AutoSize = true;
this.Controls.Add(tableLayoutPanel);
}
// resizing:
private void OnMouseWheel(MouseEventArgs e)
{
this.Bounds = new Rectangle(this.Location.X, this.Location.Y, (int)(this.Width*newScale),(int)(this.Height*newScale));
}
감사합니다.