We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Manipulate Fontsize with mouse wheel as in Visual Studio

Thread ID:





106961 Feb 4,2013 11:06 PM Feb 5,2013 03:34 AM WPF 1
Tags: EditControl
Stephan Hartmann
Asked On February 4, 2013 11:06 PM

is there a poossibilty to control font size as in Visual Studio 2010+
holding Strg and scrolling with mouse wheel
best regards

Stephan Hartmann
Replied On February 5, 2013 03:34 AM

Ok, I answer myself - it was to easy :(
I use it in a Visual Studio Plugin so i had to use PreviewMouseWheel instead OnMouseWheel

private void SQLEdit_OnMouseWheel(object sender, MouseWheelEventArgs e)
bool handle = (Keyboard.Modifiers & ModifierKeys.Control) > 0;
if (!handle) return;
if (e.Delta > 0 &&  SQLEdit.FontSize < 40.0) SQLEdit.FontSize++;

if (e.Delta < 0 &&  SQLEdit.FontSize > 5.0) SQLEdit.FontSize--;          


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.