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. Image for the cookie policy date
close icon

Manipulate Fontsize with mouse wheel as in Visual Studio

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

1 Reply

SH Stephan Hartmann February 5, 2013 08:34 AM UTC

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--;          
}

Loader.
Live Chat Icon For mobile
Up arrow icon