private void buttonMode_Click(object sender, EventArgs e) { switch (this.etatModeImage) { case modeImage.stretch: this.pictureBoxMain.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; this.buttonMode.Text = "Zoomer"; this.pictureBoxMain.Refresh(); this.etatModeImage = modeImage.center; break; case modeImage.center: this.pictureBoxMain.SizeMode = System.Windows.Forms.PictureBoxSizeMode.CenterImage; this.buttonMode.Text = "Centrer"; this.pictureBoxMain.Refresh(); this.etatModeImage = modeImage.zoom; break; case modeImage.zoom: this.pictureBoxMain.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; this.buttonMode.Text = "Etirer"; this.pictureBoxMain.Refresh(); this.etatModeImage = modeImage.stretch; break; } }
private void FormControlePrintScreen_Load(object sender, EventArgs e) { this.etatModeImage = modeImage.center; this.buttonMode.Text = "Zoomer"; FormControlePrintScreen.chargerImage(etat.initial, this); this.Focus(); }