Control Concepts

function OpenWin(url, w, h) { if(!w) w = 400; if(!h) h = 300; window.open(url, "_new", "width=" + w + ",height=" + h + ",menubar=no,toobar=no,scrollbars=yes", true); }

Regardless of the type of control being developed, its use should be immediately obvious to the user of the control. After all, if the user doesn't know what the control does, then the control serves no valid use. In addition, users expect some basic concepts to be universal among all controls. For example, users expect a left mouse click to result in an action.

Consider a menu, a toolbar, and a command button. Although each control looks different, users expect that when they left-click the control, some action will take place within the application. The action is, of course, application specific; however, the control's behavior is common among all applications. This common functionality is the cornerstone of Windows development because it allows users to learn one application and apply that knowledge to other Windows-based applications.

All Windows-based controls, both common and custom, share several common traits. These traits include the various properties and events used to define the control's appearance and behavior. Common properties include Text, ForeColor, BackColor, Size, and Location, to name a few. Standard events include Click, Focused, MouseEnter, MouseLeave, and basic key board events. These events allow for an application to respond to a user's current action. Properties and events are discussed later in this chapter.

Note

The subject of properties and events as defined within .NET development should be already familiar to you; therefore, only a brief discussion of their use is covered here.



.NET Windows Forms Custom Controls
User Interfaces in VB .NET: Windows Forms and Custom Controls
ISBN: 1590590449
EAN: 2147483647
Year: 2002
Pages: 74

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