Introduction
This is a simple application for folks who are working on UI stuff. So you can measure and align your controls in Pixels, Inches and Centimeters.
Background
You can move it around the screen by simply dragging it, you can resize the ruler by pulling its edges, and you can flip it by double clicking it.
For further control over the application, use its context menu.
Using the code
Just open the project in Visual Studio, build it, and here you go, enjoy your measurements.
The code itself is pretty strait forwarded. Ruler_Paint
- Paint event handler drawing the ruler in one of three flavors defined by Checked
property of corresponding menu items. It also draws coordinates of the ruler and its length. Mouse event handlers are responsible for moving and resizing application window. Keyboard event handler allows additional control over the location and size of the window. And finally, each menu item has its own click routine.
The only dialog is About
form. It has no logic whatsoever but just displaying some helpful information.