More New Features

Team Fly 

Page 647

Use the Toolbox to add a second form to your page. Note that forms are controls on the toolbox in CF applications. The traditional ASP.NET form (which represents a browser window), and the traditional Windows form (which represents a window) are not used here. The form in CF is merely a unit of organization, a way of grouping controls, a container for code. Forms reside within a Page object.

Add a Link control to Form1 and change its NavigateURL property to #Form2. You'll find this option and any other application targets listed in the dropdown list in the Properties window.

Now put a Label control on Form2 and change its Text property to ''You've arrived!" Press F5 and click the Link in Form1. You should see the You've arrived! message appear, demonstrating that you indeed navigated to Form2.

CF Forms offer several novel properties you should know about. There's a Method property; isn't it wonderful that a property is named method? Programmers have been driven barking mad by less. Anyway, the "Method property" describes the HTTP request—either Get or, the default, Post. The Action method can be an absolute or relative URL to which the form must submit a Get or Post, but it defaults to an empty string causing it to post back to the URL from which the form itself came. The PageCount tells you how many pages the form has when paginated, and the CurrentPage gives you the index of the current page. The PageStyle property includes a set of other properties such as color, text font, alignment, and so on, which you can use to customize the defaults used for pagination (the styles used for NextPage Text properties and such).

A Form's Deactivate event triggers when a new form becomes active via programming, or when the user navigates to a different form via a link.

More New Features

Now look at the Toolbox. You'll see some interesting controls available in no other Toolbox but the CF's: Form, PhoneCall, List, SelectionList, Object List, DeviceSpecific, and StyleSheet.

The new TextView control offers automatic pagination (within the text it displays). However the Form's Paginate property must be set to True for this to work.

The Image control has a tricky job because of the wide range of graphics capabilities of the various mobile devices. If you want to ensure the best experience for your users, you should choose images conservatively (make them rather simple and recognizable). Remember you're likely up against screens as small as 94×72 pixels in cell phones. Also you must tailor your image formats specifically to the various devices you're targeting using the device filters. Some devices will want .jpg and others some different graphics file format. .JPG is requested by Pocket Internet Explorer, for example, but WAP devices want a format you've perhaps never heard of called .wbmp. WAP also supports a .png format (Portable Network Graphics). .GIF is also popular. You just have to use a format translator (found in many graphics programs) to create the various files in the various formats. PaintShop Pro, for example, supports .png, but I couldn't find any support for .wbmp.

Just as e-mail and instant messaging users resort to emoticons and other crude symbols instead of graphics, mobile devices often include a set of symbols, clipart, icons, cartoons, or glyphs representing common graphics ideas such as lightning storms. You can employ these to liven up your output. Resources are available online and you can locate them by searching for the device you're targeting. You use the ImageURL property and specify symbol:nnnnn with nnnnn being a code or code word, such as symbol:cloudy.

Team Fly 


Visual Basic  .NET Power Tools
Visual Basic .NET Power Tools
ISBN: 0782142427
EAN: 2147483647
Year: 2003
Pages: 178

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net