update workshop 2 for resizing

This commit is contained in:
2024-02-02 11:53:06 +00:00
parent 65deb2f082
commit c3d33a227a
3 changed files with 62 additions and 37 deletions

View File

@@ -26,6 +26,8 @@ namespace workshop2
{
openFileDialog1.ShowDialog();
pictureBox1.Load(openFileDialog1.FileName);
//pictureBox1.Size = pictureBox1.Image.Size;
pictureBox1.SizeMode = AutoSize(true);
}
private void quitButton_Click(object sender, EventArgs e)
@@ -49,5 +51,13 @@ namespace workshop2
pictureBox1.Image = image;
pictureBox1.Refresh();
}
private void Form1_Load(object sender, EventArgs e)
{
this.MinimumSize = new System.Drawing.Size(this.Width, this.Height);
this.MaximumSize = new System.Drawing.Size(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height);
this.AutoSize = true;
this.AutoSizeMode = AutoSizeMode.GrowAndShrink;
}
}
}