// scroll trough images with mouse wheel private void imagePanel_MouseWheel(object sender, MouseEventArgs e) { if (!imagePanel.ClientRectangle.Contains(e.Location) || imagePanel.BackgroundImage == null) { return; } // change size of face rectangle in face mode if (mode == Constants.faceMode && Control.ModifierKeys == Keys.Control) { if (e.Delta > 0) { rectangles.rescaleRect(0, Constants.modeFRectDeltaSize, Constants.modeFRectScale); } else { rectangles.rescaleRect(0, -Constants.modeFRectDeltaSize, Constants.modeFRectScale); } imagePanel.Refresh(); return; } saveCoordinates(); if (e.Delta > 0) { // user scrolled up scrollUp(); } else { // user scrolled down scrollDown(); } if (!isLoaded) { rectangles.resetCoordinates(rectSPostion[mode - Constants.faceElementsMode]); } rectangles.resetFocusList(); someoneIsInFocus = false; imagePanel.Refresh(); }