The Actipro Blog

All the latest UI control development news from Actipro

SyntaxEditor for WPF - Mouse wheel zooming

One new feature that has been requested by our customers is support for mouse wheel zooming.  Basically when you hold down the Ctrl key and turn the mouse wheel you can increase or decrease the zoom level of the editor.

Zooming in is ideal when you are doing overhead presentations.  Zooming out is useful for getting a larger picture of your document.

We’ve made this feature very configurable too.  The SyntaxEditor.ZoomLevel property sets the current scale factor of the control.  A value of 1.0 means 100%.  MinZoomLevel and MaxZoomLevel properties can be used to set the range of allowed ZoomLevel values.  The default minimum is 0.5 and the default maximum is 3.0, but these can be changed to anything you wish.

When the SyntaxEditor.IsMouseWheelZoomEnabled property is true (the default), mouse wheel zooming is enabled, allowing zooming between the minimum and maximum zoom level settings.

Zoom

SyntaxEditor in the midst of a change to 150% zoom level, with an adornment animating and displaying the new zoom level to the end user

As the control is zoomed in or out via the mouse, a small adornment appears indicating the current zoom level percentage.  It subtly fades way over a brief period.  In addition if you are zooming in, it grows slightly and if you are zooming out, it shrinks slightly.  Altogether it’s a very nice way to know what zoom level you are at without having to bind to another control to tell you.

While these properties are all geared for easy use with the mouse wheel, you can also bind the ZoomLevel property to a Slider, perhaps in the status bar of your window.

UPDATE: See the second post on mouse wheel zooming for updated information and new features!

Filed under: Actipro, In development, WPF
Comments are closed