Blog Home  Home Feed your aggregator (RSS 2.0)  
What did you learn today? - 70-552 Section II Part II - WinForm controls
Phil Denoncourt's Technology Rants
 
 Wednesday, February 15, 2006

Add and configure a Windows Forms control.

  • Use the integrated development environment (IDE) to add a control to a Windows Form or other container control of a project at design time.
  • Add controls to a Windows Form at run time.
  • Configure controls on a Windows Form at design time to optimize the UI.
  • Modify control properties.
  • Configure controls on a Windows Form at run time to ensure that the UI complies with best practices.
  • Create and configure command controls on a Windows Form.
  • Create and configure text edit controls on a Windows Form.
  • Create and configure text display controls on a Windows Form.
  • Use the LinkLabel control to add Web-style links to Windows Forms applications.
  • Provide a list of options on a Windows Form by using a ListBox control, a ComboBox control, or a CheckedListBox control.
  • Configure the layout and functionality of a Windows Form to display a list of items.
  • Implement value-setting controls on a Windows Form.
  • Configure a WebBrowser control.
  • Add and configure date-setting controls on a Windows Form.
  • Display images by using Windows Forms controls.
  • Configure the NotifyIcon component.
  • Create access keys for Windows Forms controls.

The first 4 bullets shouldn't be worrisome.  As far as as UI Best Practices, I imagine stuff like consistency, making sure your UI works with both mouse and keyboard, and making sure it functions with accessibility features are the key.  The only best practices guidance I found specific to 2.0 is this blurb on MSDN2 about the datagridview.

Here is a list of things that have changed in 2.0.  Here is a list of new features.

The command controls available in WinForms is really just the Button class.  Few things have changed since 1.1.  There's a FlatAppearance method-allowing finer control when the FlatStyle is set to Flat.  TextImageRelation specifies where the text goes in relation to an image.  There is also an AutoEllipsis property that adds the ... if your text is too long for the button.

Text Edit controls in WinForms are the ComboBox, DateTimePicker, DomainUpDown, ListBox, the new MaskedTextBox, NumericUpDown,PropertyGrid, RichTextBox, and the basic TextBox.  There is support for AutoComplete in the ComboBox and TextBox via the AutoCompleteCustomSource, AutoCompleteMode, and AutoCompleteSource properties.  I haven't used the DateTimePicker much before, but it doesn't appear to have changed.  Same for the DomainUpDown control.  The Listbox now has formatting via the FormattingEnabled and FormatString properties.  The MaskedTextBox is new, you should play around with it to understand it's features.  Jesse Liberty has a writeup on the masking features.  The NumericUpDown control hasn't changed either.  Same with the PropertyGrid.  The RichTextBox control has a RTF property that you can get/set the text including RTF codes.

The display controls in WinForms are Label, ListView, PictureBox & Treeview.  Label control has the AutoEllipsis property.  That's the only change I could see.  There are some good changes to the ListView control.  It has support for Groups and TileView.  Jeremy Epling has a writeup on Groups on his blog.   The other big change is that the ListView is bindable (Yeah!).  The PictureBox now supports Asychronous loading.  The ListView and TreeView now support Owner drawing.

The linkLabel hasn't changed.  Use it as you would a Button, except that you handle the LinkClicked event.

The CheckedListBox has the same new properties as the Listbox as far as Formatting.  It also has a new property ThreeDCheckBoxes (bool). 

To display a list of items, you could use either a CheckedListbox, ComboBox, DomainUpDown, Listbox, ListView, or TreeView.  CheckedListbox, Listbox, and ListView support multiple columns.

The WebBrowser is a new control that a hosting container for the browser.  You specify the location by setting the Url property.

You can display images a variety of different ways.  You can set the background image of a form and various controls, use a PictureBox control, you can handle the Paint event and use the graphics object to paint an image.

The NotifyIcon component now has BalloonTips.  These should be used to notify the user that something has happened.

Access keys are still defined by prefixing with an "&"

Next up-> Menus

Wednesday, February 15, 2006 6:21:37 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Certifications  | 
Comments are closed.
Copyright © 2010 Phil Denoncourt III. All rights reserved.
DasBlog 'Portal' theme by Johnny Hughes.
Pick a theme: