Click here to Skip to main content
11,631,534 members (59,600 online)
Click here to Skip to main content

Tagged as

Building OpenPOS: Part 6 – Make it look pretty…

, 6 May 2010 CPOL 7K 2
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. Smile | :)

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.MergedDictionaries>
    <ResourceDictionary Source="Themes\ExpressionDark.xaml" />                
</ResourceDictionary.MergedDictionaries>

And it looks a little better… all for free!

Here is the source:

License

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

Share

About the Author

rudigrobler
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    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
Web04 | 2.8.150723.1 | Last Updated 6 May 2010
Article Copyright 2010 by rudigrobler
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid