Skip to main content

Past Blast

Featured Products

Windows Mobile Developer Controls
Windows Mobile Developer Controls
Stay in touch using the DEVBUSS RSS feeds.
 

News

Windows Mobile Developer Controls
Windows Mobile Developer Controls

eVB Skinnable Keyboard

Written by Simon Rackstraw  [author's bio]  [read 47320 times]
Edited by Derek

Download the code

Page 1  Page 2  Page 3 

Adding the keyboard to your own projects

In order to use the keyboard in your own eVB applications you must first copy the files mdiKeyboard.ebf and mdiKeyboard.bmp into your application's project directory. Then complete the following steps to include them in your project build.

1) Right-click in the eVB project explorer window and select Add>Form.
2) In the window that pops up, select the Existing tab.
3) Find and open the mdiKeyboard.ebf form file.
4) Right-click again in the project explorer window and select Add>Add file.
5) In the window that pops up, change Files of type to All files (*.*).
6) Tick the Add as related document checkbox, in the bottom-left corner.
7) Find and open the mdiKeyboard.bmp picture file.

Note: All API functions and constants have been prefixed with "mdi" in order to ensure that there are no conflicts with any declarations you may have already made.

Using the keyboard is very simple. The keyboard is activated by calling mdiKeyboard.Show and deactivated with mdiKeyboard.Hide just like any other form.

Customization

If you want to create your own customized keyboard layouts (perhaps a large numeric only keypad) you first need to decide on a button size, then draw the keyboard image. I suggest using JASC's Paint Shop Pro for this job, remembering to only use 256 colors and save in Windows RGB .bmp format.

Once you have created your keyboard image, adjust the mdiKeyboard (form) and KeyboardBox (PictureBox) size and position parameters to suit your picture. Next, alter the constants mdiKeyWidth and mdiKeyHeight to match your chosen key size. And finally, create a new KeyMatrix array to define the identity of your keys.

Good luck! If you have any questions or feedback please click the Discuss article button at the top of the page. I can usually be found hovering around the DEVBUZZ forums...

Previous Page