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

Use eVB to create display and edit forms for your Pocket PC.

Written by Carl Davis  [author's bio]  [read 28030 times]
Edited by Derek

Page 1  Page 2 

The Pocket PC is an ideal platform for carrying information around that you need to review often and occasionally edit. This leaves a developer with a dilemma - do I optimize the display for entry or for displaying information. Microsoft solved this problem for the contacts function by having two screens. Unfortunately, the screens are completely different and editing requires the user to scroll through all the fields. I've found that there is an alternative. This article presents a simple technique to create eVB forms that allow users to edit information without jumping to another screen.

The example in Figure 1 shows a hypothetical screen designed to display statistics for a football player. This might be something a fantasy football fan would keep handy to compare his or her players with friends. The important thing to note (besides the fact the player is a very good running back) is that there is a lot of information crammed on the screen and it is laid out to optimize it's utility to the viewer. All of the text display elements in this example are Label controls. To allow the user to update the information on this player, I want to allow them to tap and edit without jumping to an entirely different layout or form. Using a few simple steps we can allow the user to tap on any of the fields and edit it.


Figure 1

By manipulating and repositioning controls we can make a text box, combo box, or other control element appear ready for input from the user without leaving the screen. Figure 2 shows how the application responds when the user taps on the player's name "Ed V. Barber" (his friends call him edVB). The text box appears with the name highlighted. Once the user taps on a different part of the form or the "OK" button the text box disappears.


Figure 2

To demonstrate how this is accomplished, I'll use a simple text box and one of our fields on the player statistics form. However, the routines provided are easily modified to work with combo boxes, check boxes, or other controls.

To follow along create a form with the following controls: a Text Box named txtEntry and a command button named cmdOK with a caption of "OK", a Frame called Frame1, and finally two labels called lblNameDisplay and lblNameHeader which are placed into Frame1. lblNameHeader is the label that say "Name:" and lblNameDisplay will contain our information (edVB's name).

Listing 1 on the next page shows the functions we need to handle moving and displaying the list box.

Next Page