CHAPTER 9 s WINDOWS FORMS UI
Printing PDF 417 In VB.NET
Using Barcode creation for .NET framework Control to generate, create PDF417 image in .NET applications.www.OnBarcode.com
PDF417 Decoder In Visual Basic .NET
Using Barcode scanner for .NET framework Control to read, scan read, scan image in .NET applications.www.OnBarcode.com
Figure 9-14. Layout of the ProjectEdit user control
Create GTIN - 128 In Visual Basic .NET
Using Barcode printer for Visual Studio .NET Control to generate, create EAN / UCC - 14 image in Visual Studio .NET applications.www.OnBarcode.com
Paint ANSI/AIM Code 39 In Visual Basic .NET
Using Barcode drawer for Visual Studio .NET Control to generate, create Code-39 image in VS .NET applications.www.OnBarcode.com
As you can see, this form has a set of Label and TextBox controls so the user can view and edit information in the Project object itself. It also uses a DataGridView control to display the ProjectResource objects. That DataGridView will also allow the user to change the role a resource plays on a project. Additionally, the values in the FullName column will be displayed as hyperlinks to make it easy for the user to bring up the associated ResourceEdit user control for that resource. Implementing the functionality behind this form is more complex than RolesEdit or ResourceSelect. But still, the focus is entirely on user interaction and the flow of the UI, not on authorization, validation, or other business behaviors already implemented in the business objects.
Making Code 128 In Visual Basic .NET
Using Barcode drawer for .NET Control to generate, create Code128 image in Visual Studio .NET applications.www.OnBarcode.com
Barcode Creation In VB.NET
Using Barcode encoder for .NET Control to generate, create Barcode image in VS .NET applications.www.OnBarcode.com
Creating the Controls
Paint Matrix In VB.NET
Using Barcode encoder for .NET Control to generate, create Matrix image in VS .NET applications.www.OnBarcode.com
Create 2 Of 5 Interleaved In Visual Basic .NET
Using Barcode drawer for .NET framework Control to generate, create ANSI/AIM ITF 25 image in Visual Studio .NET applications.www.OnBarcode.com
The controls shown in Figure 9-14 were all added using drag-and-drop data binding. The Label and TextBox controls were added by dragging the Project object from the Data Sources window onto the designer, after setting some options in the Data Sources window.
PDF417 Maker In None
Using Barcode creator for Word Control to generate, create PDF417 image in Microsoft Word applications.www.OnBarcode.com
PDF 417 Creator In None
Using Barcode generator for Font Control to generate, create PDF-417 2d barcode image in Font applications.www.OnBarcode.com
Binding to the Project Class
Recognize QR In Java
Using Barcode decoder for Java Control to read, scan read, scan image in Java applications.www.OnBarcode.com
PDF-417 2d Barcode Generator In None
Using Barcode drawer for Microsoft Excel Control to generate, create PDF 417 image in Excel applications.www.OnBarcode.com
Figure 9-15 shows the Data Sources window with the Projects node expanded and being changed to create a details form.
Paint UPCA In Objective-C
Using Barcode generation for iPhone Control to generate, create Universal Product Code version A image in iPhone applications.www.OnBarcode.com
Encoding UPCA In Java
Using Barcode encoder for Eclipse BIRT Control to generate, create UPC Symbol image in BIRT reports applications.www.OnBarcode.com
CHAPTER 9 s WINDOWS FORMS UI
Barcode Printer In Java
Using Barcode creator for Eclipse BIRT Control to generate, create Barcode image in BIRT applications.www.OnBarcode.com
Barcode Drawer In None
Using Barcode encoder for Software Control to generate, create Barcode image in Software applications.www.OnBarcode.com
Figure 9-15. Project node ready to create a details form
EAN / UCC - 13 Reader In Visual Basic .NET
Using Barcode reader for VS .NET Control to read, scan read, scan image in .NET applications.www.OnBarcode.com
ANSI/AIM Code 39 Generator In None
Using Barcode generation for Software Control to generate, create Code 39 Extended image in Software applications.www.OnBarcode.com
Notice the icon next to the Project node: it represents a details form rather than the default grid display icon you see next to ProjectList, Resource, and the other object nodes. This change occurred because I chose the Details option from the menu for the Project node. When an object is set to use details mode, the individual control types of the properties for that object come into play. When the object is dragged onto the designer, controls for each property will be created. In fact, a pair of controls is created: a Label displaying the property name and another control to display the property value itself. This second control is indicated by the icons you see next to each property node in the Data Sources window. The Id property on a Project object is read-only, and so it should be displayed in a Label rather than an editable control. Figure 9-16 shows how the Id property s control is changed from TextBox to Label.
Code 128 Code Set A Creator In Visual C#.NET
Using Barcode creator for .NET Control to generate, create Code 128A image in Visual Studio .NET applications.www.OnBarcode.com
ECC200 Printer In None
Using Barcode printer for Excel Control to generate, create Data Matrix ECC200 image in Excel applications.www.OnBarcode.com
Figure 9-16. Changing the Id property to display in a Label
Once the object node is set to details mode and all its properties are set to use the correct control types, the object is simply dragged onto the designer. Visual Studio creates a ProjectBindingSource, all the controls for the properties, and of course the BindingNavigator control.
CHAPTER 9 s WINDOWS FORMS UI
You can then resize and reposition the controls to get the display you require. The layout in Figure 9-14 shows the result after I ve repositioned the controls, resized them, set their Anchor properties, and changed their tab order to match the new layout. And of course, I ve removed the BindingNavigator control. But at no point did I need to worry about setting up the data binding for any controls; Visual Studio handled that automatically. My only concern is the appearance of the UI itself.
If you prefer, you could put the controls on the form manually, directly from the toolbox. Then you could use connect-the-dots binding to drag each object property from the Data Sources window onto the controls to set up the data binding. Or if you really like manual work, you could manually set the data properties on each control through the Properties window. Regardless of which approach you take, the results are the same: the controls are data bound to the ProjectBindingSource control, which in turn will be bound to a Project object.
You may be wondering why the Started and Ended properties are bound to TextBox controls rather than a specialized date-entry control. As discussed in 5, it is often preferable to allow the user to enter dates as he or she chooses especially for heads-down data entry. Given the extra parsing capabilities of SmartDate, this makes even more sense, since the user can simply press -, ., or + to get yesterday, today, or tomorrow s date.