나는 창 크기가 바뀌면 화면 비율에 따라 크기를 조절해야하는 몇 개의 그림 상자를 가지고 있습니다. 너비를 고정 할 수 있다고 가정했지만 높이를 수동으로 설정했습니다. 즉, 왼쪽, 오른쪽 및 위쪽 가장자리를 고정하지만 아래쪽은 고정하지 않습니다. 그러나 Size 속성을 변경하려고하면 컨트롤이 크기가 조정되지 않습니다. 왜 그게 효과가 없을까요? 내 컨트롤의 크기를 조정하려면 어떻게해야합니까?.net 크기 조정 컨트롤이 작동하지 않습니까?
private void Form1_Resize(object sender, System.EventArgs e)
{
int oldWidth = 1280;
int oldHeight = 1024;
int newWidth = webcamPictureBox.Size.Width; // this is auto-resized w/ window; becomes 591
int newHeight = (oldHeight * newWidth)/oldWidth; // this is calculated manually; becomes 472
// Control won't resize if I change the Size property
// Size property stays the same
this.webcamPictureBox.Size = new Size(newWidth, newHeight);
this.thumbnailPictureBox.Size = new Size(newWidth, newHeight);
}