Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Last active December 9, 2020 10:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjoerntx/4e05bf4eea74ec71ccce87debba91249 to your computer and use it in GitHub Desktop.
Save bjoerntx/4e05bf4eea74ec71ccce87debba91249 to your computer and use it in GitHub Desktop.
private void textControl1_KeyDown(object sender, KeyEventArgs e) {
//increase zoom by ten percent when pressing CTRL + Plus
int currZoom = textControl1.ZoomFactor;
if (e.Control && (e.KeyCode == Keys.Oemplus)) {
textControl1.Zoom(currZoom + 10);
}
//decrease zoom by ten percent when pressing CTRL + Minus
if (e.Control && (e.KeyCode == Keys.OemMinus)) {
textControl1.Zoom(Math.Max(10, currZoom - 10));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment