The Application s Interface

Team Fly 

Page 507

supplier name on the form. When users edit a product, they should be able to select a category and a supplier by name from a list. To facilitate this operation, we'll download the tables with the categories and suppliers to the client. We're assuming that these two tables aren't edited frequently and users will almost always find the desired category and supplier in a DataSet at the local machine.

The Application's Interface

The application's main form is shown in Figure 18.1. Users can select the product to view or edit on the form shown in Figure 18.2. This form is invoked when users click the button with the question mark on the application's main form. On the Product Search Form users can select a product by name, by category, or by supplier. To view the products in a given category, or the products by a given supplier, they can simply select the desired category or supplier on the appropriate ComboBox control. Every time users select another item on either list, the corresponding products are displayed on a ListView control at the bottom of the form. To select products by name they must enter part of the product's name in the top TextBox control and press Enter.

The matching products are displayed on a ListView control at the lower half of the form, where users can double-click a product's name, or press Enter, to view the selected product's details on the program's main form. The auxiliary form will close and the selected product's fields will be displayed on the main form. While viewing products, the controls on the main form are locked. The Edit button unlocks the controls for editing and it also changes the background color of the various controls on the form to indicate that the controls can be edited. The editing process must end with the OK or Cancel button. While editing, users are not allowed to select another product.

image

FIGURE 18.1 Editing the Products table with the NWProducts application

image

FIGURE 18.2 Locating the product to view or edit with the NWProducts application

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