Click here to Skip to main content
Licence 
First Posted 14 Sep 2004
Views 99,674
Bookmarked 40 times

Ruler Application

By | 14 Sep 2004 | Article
Ruler tool application.

Sample Image - Ruler_Application.png

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.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Eugene Lepekhin

Software Developer

United States United States

Member



Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralSuggestion PinmemberRadgar6:22 9 Sep '09  
GeneralJeff Key's Ruler tool PinmemberThomas Freudenberg22:12 14 Sep '04  
GeneralRe: Jeff Key's Ruler tool PinmemberJeffrey Scott Flesher19:56 27 Nov '04  
GeneralMaybe rename to "Ruler Control" or "Rule Control" Pinmembernorm.net21:30 14 Sep '04  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web01 | 2.5.120517.1 | Last Updated 15 Sep 2004
Article Copyright 2004 by Eugene Lepekhin
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid