private void ZoomButton_MouseDown(object sender, MouseEventArgs e) { if (e.Button != MouseButtons.Left) { return; } var ctrl = ((Control)sender); var adjustement = (ImageZoomAdjustement)ctrl.Tag; DoAdjustement(adjustement); _lastClickType = adjustement; tmrScrollDelay.Start(); }
private void DoAdjustement(ImageZoomAdjustement adjustementType) { switch (adjustementType) { case ImageZoomAdjustement.Enlarge: PannablePictureBox.EnlargeImage(); break; case ImageZoomAdjustement.Shrink: PannablePictureBox.ShrinkImage(); break; case ImageZoomAdjustement.None: break; default: throw new ArgumentOutOfRangeException(nameof(adjustementType), adjustementType, null); } }