Click here to Skip to main content
12,559,281 members (45,957 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


2 bookmarked

Building OpenPOS: Part 6 – Make it look pretty…

, 6 May 2010 CPOL
Rate this:
Please Sign up or sign in to vote.
Before I can start with cosmetic surgery, let's just finish off the SalesModule.

Before I can start with cosmetic surgery, let's just finish off the SalesModule. The last thing I added here is the Keypad! The keypad is used to type in the barcode and also has an increment decrement button.

I used an ugly hack but I need to suck in all the key presses. If I attach a barcode scanner, it acts like a keyboard so I need to get all the keys pressed (0-9) and also the enter, + and – keys, the rest is ignored. Here is the code that achieves this:

Application.Current.MainWindow.PreviewKeyDown += WindowPreviewKeyDown;

and here is the event handler:

private void WindowPreviewKeyDown(object sender, System.Windows.Input.KeyEventArgs e)
    // Look at e.Key and if you use it set e.Handled = true

Now we can start making the application look pretty! Hopefully everybody that still reads this blog knows that I am not a designer but luckily there is some help for us developers. :)

I downloaded the WPF Themes from CodePlex and added it to my project. All that is left to do is add it to the resource dictionary:

    <ResourceDictionary Source="Themes\ExpressionDark.xaml" />                

And it looks a little better… all for free!

Here is the source:


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

South Africa South Africa
No Biography provided

You may also be interested in...


Comments and Discussions

GeneralLinks Don't Work Pin
Member 36942812-May-11 6:39
memberMember 36942812-May-11 6:39 

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

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

| Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.161026.1 | Last Updated 6 May 2010
Article Copyright 2010 by rudigrobler
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid