| Larry's profileLarry West MCSDPhotosBlogLists | Help |
|
December 04 Part II of Larry West's Study Guide for 70:563: Pro: Designing and Developing Windows Applications Using the Microsoft .NET Framework 3.5563.4.0 Designing security implementation (15 percent) -- 563.4.1. Design role-based security. -- .NET Framework role-based security supports authorization by making information about the principal, which is constructed from an associated identity, available to the current thread. The identity (and the principal it helps to define) can be either based on a Windows account or be a custom identity unrelated to a Windows account. .NET Framework applications can make authorization decisions based on the principal's identity or role membership, or both. A role is a named set of principals that have the same privileges with respect to security (such as a teller or a manager). A principal can be a member of one or more roles. Therefore, applications can use role membership to determine whether a principal is authorized to perform a requested action. -- May include but is not limited to: 563.4.1.1. implementing security by using IPrincipal and IIdentity, -- A principal object represents the security context of the user on whose behalf the code is running, including that user's identity (IIdentity) and any roles to which they belong. All principal objects are required to implement the IPrincipal interface. An identity object represents the user on whose behalf the code is running. IPrincipal.IsInRole determines whether the current principal belongs to the specified role. IPrincipal.Identity property gets the identity of the current principal. IIdentity.AuthenticationType gets the type of authentication used. (The authentication type is passed to the common language runtime by the operating system or by another authentication provider. Basic authentication, NTLM, Kerberos, and Passport are examples of authentication types.). IIdentity.IsAuthenticated get s a value that indicates whether the user has been authenticated, and IIdentity.Name gets the name of the current user. 563.4.1.2. custom vs. platform security, -- 563.4.1.3. managing user functionality, -- 563.4.1.4. limit or gate access, -- 563.4.1.5. data decoupling, -- 563.4.1.6. designing security profiles --
563.4.2. Design data transmission and storage. -- -- May include but is not limited to: 563.4.2.1. SSL, -- 563.4.2.2. encryption (offline data, password management) --
563.4.3. Design authentication and authorization. -- -- May include but is not limited to: 563.4.3.1. login mechanism (domain user accounts, SQL Server user accounts), -- 563.4.3.2. role-based application configuration, -- 563.4.3.3. security auditing and logging, -- 563.4.3.4. file system rights and authorization, -- 563.4.3.5. Web service rights and authentication --
563.4.4. Plan Windows Vista compliance. -- -- May include but is not limited to: 563.4.4.1. user application data directory (registry settings, isolated storage) --
563.4.5. Plan least-privileged execution. -- -- May include but is not limited to: 563.4.5.1. User Access Control (UAC), -- 563.4.5.2. assembly authentication, -- 563.4.5.3. certificate management --
563.5.0. Planning application deployment and maintenance (11 percent) -- 563.5.1. Select an installer. -- -- May include but is not limited to: 563.5.1.1. ClickOnce, -- 563.5.1.2. MSI, -- 563.5.1.3. XCOPY, -- 563.5.1.4. third party (InstallShield) -- 563.5.2. Plan for multiple-component application deployment. -- -- May include but is not limited to: 563.5.2.1. bootstrap installation, -- 563.5.2.2. legacy applications, -- 563.5.2.3. application suite, -- 563.5.2.4. COM-visible assemblies -- 563.5.3. Plan application re-deployment. -- -- May include but is not limited to: 563.5.3.1. deploying Windows-based applications and updating, -- 563.5.3.2. deploying a patch (dependencies on service packs), -- 563.5.3.3. database synchronization (re-deployment of data in place [merge]), -- 563.5.3.4. preserving configuration, -- 563.5.3.5. unattended installation --
563.5.4. Plan database deployment. -- -- May include but is not limited to: 563.5.4.1. existing or shared instance; -- 563.5.4.2. remote server; -- 563.5.4.3. DLL deployment; -- 563.5.4.4. shared GAC deployment; -- 563.5.4.5. embedded database --
563.5.5. Plan application removal. -- -- May include but is not limited to: 563.5.5.1. clean uninstall, -- 563.5.5.2. uninstalling shared components, -- 563.5.5.3. uninstalling remaining components, -- 563.5.5.4. restoring client state, -- 563.5.5.5. clean or restore registry --
563.5.6. Plan a performance-monitoring strategy. -- -- May include but is not limited to: 563.5.6.1. profiling, -- 563.5.6.2. tracing, -- 563.5.6.3. performance counters, -- 563.5.6.4. audit trails --
563.5.7. Plan an exception-management strategy. -- -- May include but is not limited to: 563.5.7.1. implementing a framework for logging and exception handling, -- 563.5.7.2. error handling and reporting, -- 563.5.7.3. user feedback --
563.6.0. Designing the application architecture (17 percent) -- 563.6.1. Plan a globalization and localization strategy. -- -- May include but is not limited to: 563.6.1.1. embedding resources into the application for localization --
563.6.2. Design for accessibility. -- -- May include but is not limited to: 563.6.2.1. screen reader, -- 563.6.2.2. tool tips --
563.6.3. Plan an application migration strategy. -- -- May include but is not limited to: 563.6.3.1. interoperability with legacy applications, -- 563.6.3.2. integrating with non-Forms applications --
563.6.4. Design n-layer architecture. -- -- May include but is not limited to: 563.6.4.1. logically separating concerns (business objects layer or tier, data tier), -- 563.6.4.2. design project structure (effective use of sub projects) --
563.6.5. Plan a component re-use strategy. -- -- May include but is not limited to: 563.6.5.1. sharing common resources, -- 563.6.5.2. coupling of generic elements to specific elements, -- 563.6.5.3. Object-Oriented modeling techniques, -- 563.6.5.4. dealing with COM interoperability issues associated with existing legacy components --
563.6.6. Plan system resource management. -- -- May include but is not limited to: 563.6.6.1. understand JIT or GAC caching --
563.6.7. Plan multi-threaded implementation and UI responsiveness. -- -- May include but is not limited to: 563.6.7.1. implementing multi-threading and reporting progress, -- 563.6.7.2. updating the UI from a background thread --
563.7.0. Designing for optimized performance (11 percent) -- 563.7.1. Plan optimized data retrieval. -- -- May include but is not limited to: 563.7.1.1. type data sets vs. un-typed data sets, -- 563.7.1.2. entity models, -- 563.7.1.3. ORM [object role modeling] performance, -- 563.7.1.4. performance monitoring of tiers for latency and chunkiness (batch retrieval, multiple small calls), -- 563.7.1.5. roundtrip optimization, -- 563.7.1.6. caching of frequently used data (pick List data, drop down data, list boxes) --
563.7.2. Design state management. -- -- May include but is not limited to: 563.7.2.1. storing application state, -- 563.7.2.2. storing user state, -- 563.7.2.3. managing server-side state --
563.7.3. Plan resource management. -- -- May include but is not limited to: 563.7.3.1. memory, -- 563.7.3.2. GDI handles, -- 563.7.3.3. unmanaged resources, -- 563.7.3.4. resource disposition memory management, -- 563.7.3.5. resource planning (skill set to project tasks), -- 563.7.3.6. order of application component development -- Part I of Larry West's Study Guide for 70-563: Pro: Designing and Developing Windows Applications Using the Microsoft .NET Framework 3.5Skills being measured by Exam 70-563 This exam measures your ability to accomplish the technical tasks listed in the following table. The percentages indicate the relative weight of each major topic area on the exam.563.1.0 Validating an application design against specifications (12 percent) -- 563.1.1. Analyze the technical feasibility of application design. -- -- May include but is not limited to: 563.1.1.1. architecture (Windows vs. ASP), -- 563.1.1.2. resourcing (staffing, skill sets, hardware, OS), -- 563.1.1.3. network capacity and distribution, -- 563.1.1.4. application extensibility, -- 563.1.1.5. existing applications, -- 563.1.1.6. exposing APIs, -- 563.1.1.7. timeframe, -- 563.1.1.8. integration of third-party controls, -- 563.1.1.9. applications, -- 563.1.1.10. external data sources --
563.1.2. Validate proof of concept. -- Proves the feasibility of a design. -- May include but is not limited to: 563.1.2.1. evaluating the technical specification and comparing against the proof of concept --
563.1.3. Evaluate design against available resources. -- -- May include but is not limited to: 563.1.3.1. cost, -- 563.1.3.2. timeframe, -- 563.1.3.3. resources (local vs. distributed teams), -- 563.1.3.4. hardware resources, -- 563.1.3.5. network resources, -- 563.1.3.6. customer infrastructure (required hardware such as servers, routers, and RAM and required software such as OS) --
563.1.4. Evaluate testing requirements. -- -- May include but is not limited to: 563.1.4.1. stress testing, -- 563.1.4.2. testing against high activity and frequency of operations, -- 563.1.4.3. testing with a true representative sample, -- 563.1.4.4. building test cases --
563.2.0 Planning data management (17 percent) -- 563.2.1. Plan data access strategy. -- A data access strategy is the manner in which applications store, retrieve and manage data. Performance, deployment, and scalability, which factor into the planning and implementation of a data access strategy, can ultimately affect the architectural model. -- May include but is not limited to: 563.2.1.1. retrieve data from disparate data sources (XML data, flat files, and relational databases, manage class-generated data, LINQ), -- 563.2.1.2. manage bulk imports and exports (ETL, data transformation), -- 563.2.1.3. choose appropriate data access layer, -- 563.2.1.4. manage data purity (re-validate data across trust boundaries), -- 563.2.1.5. manage data asynchronously, -- 563.2.1.6. leverage synchronization services, -- 563.2.1.7. connection management --
563.2.2. Plan data caching and persistence strategy. -- -- May include but is not limited to: 563.2.2.1. managing data cache, -- 563.2.2.2. managing data persistence (storing disconnected scenarios, managing offline data), -- 563.2.2.3. mapping database to local cache (loading all customers locally), -- 563.2.2.4. managing data state --
563.2.3. Select a data storage mechanism. -- -- May include but is not limited to: 563.2.3.1. security, -- 563.2.3.2. target data engine, -- 563.2.3.3. target environment (workstation capabilities, OS, bandwidth, domain vs. workgroup, connectivity, reliability) --
563.2.4. Plan application data sharing. -- -- May include but is not limited to: 563.2.4.1. managing data shared between forms and processes, -- 563.2.4.2. managing data synchronization (ADO.NET synchronization services), -- 563.2.4.3. drag and drop files or objects from outside sources --
563.2.5. Design a schema evolution management strategy. -- -- May include but is not limited to: 563.2.5.1. synchronizing an application with a schema --
563.2.6. Design a concurrency management strategy. -- -- May include but is not limited to: 563.2.6.1. database segmentation, planning for concurrency and collision avoidance, optimistic vs. pessimistic --
563.3.0. Planning user interaction and presentation strategy (17 percent) -- 563.3.1. Design application content flow. -- -- May include but is not limited to: 563.3.1.1. user navigation, -- 563.3.1.2. user interface goals, -- 563.3.1.3. layout techniques (dynamic layout techniques), -- 563.3.1.4. components not part of control data class (ToolTipProvider, ErrprProvider, HelpProvider) --
563.3.2. Plan data capture. -- -- May include but is not limited to: 563.3.2.1. validating input (type converters, regular expressions, apply business rules), -- 563.3.2.2. responding to mouse and keyboard input, -- 563.3.2.3. pick list (combo boxes, list boxes, auto-fill text boxes) --
563.3.3. Design a reporting strategy. -- -- May include but is not limited to: 563.3.3.1. MicrosoftReportViewer, -- 563.3.3.2. CrystalReportViewer, -- 563.3.3.3. print classes, -- 563.3.3.4. embedded vs. external server-generated reports --
563.3.4. Design user interface components. -- -- May include but is not limited to: 563.3.4.1. common dialog boxes, -- 563.3.4.2. designing navigation by using menus, -- 563.3.4.3. SDI and MDI (multiple monitor configuration, implementing master and detail), -- 563.3.4.4. single vs. multiple instances of the application, -- 563.3.4.5. implementing data binding, -- 563.3.4.6. abstracting with custom controls (abstract base classes), -- 563.3.4.7. using and creating user controls (extend a custom control to add functionality, -- 563.3.4.8. creating a custom DataGridView column), -- 563.3.4.9. integrating with non-Forms UI elements --
563.3.5. Design a data-binding strategy. -- -- May include but is not limited to: 563.3.5.1. populating from XML, -- 563.3.5.2. populating from SQL, -- 563.3.5.3. populating from object data source and entity, -- 563.3.5.4. lazy loads, -- Lazy Loading is an object relational pattern which is used to defer the initialization of an object until its needed. The object will not contain all of the data, but it knows how to get all of them when they are needed. The object to be lazily loaded is originally set to null, and every request for the object checks for null and creates it "on the fly" before returning it first. There are four main ways you can implement Lazy Load: lazy initialization, virtual proxy, value holder, and ghost. This is an example on how to apply lazy Initialization in your class. public class Order In this way, the first access to the Customer property will causes the customer object to be loaded. Note : It's not always a good practice to use lazy loading, especially if loading the object requires a lot of time and resources, like accessing a webservice. In that case it's better to deep load all the required data in the object. 563.3.5.5. updating bound data (concurrency management, late commits, lazy commits), -- 563.3.5.6. data context --
563.3.6. Design forms inheritance. -- -- May include but is not limited to: 563.3.6.1. visual inheritance, -- 563.3.6.2. functionality common across forms --
Part IV of Larry West''s Study Guide for 70-505: TS: Microsoft .NET Framework 3.5, Windows Forms Application DevelopmentThis is the last part -- Remember this is still a work in progress. If you find this helpful, please help me fill in the blanks. Thanks.
505.6.0. Deploying Windows Forms Controls --
505.6.1. Create a composite Windows Forms control. -- -- This objective may include but is not limited to: 505.6.1.1. create properties, -- 505.6.1.2. methods and events, -- 505.6.1.3. expose properties of constituent controls, -- 505.6.1.4. create custom dialog boxes, -- 505.6.1.5. customize a control’s paint and render, -- 505.6.1.6. set visibility at run time, -- 505.6.1.7. provide a toolbox bitmap --
505.6.2. Create a custom Windows Forms control by inheriting from the control class --
505.6.3. Create an extended control by inheriting from an existing Windows Forms control --
505.7.0. Configuring and Deploying Applications -- 505.7.1. Configure the installation of a Windows Forms application by using ClickOnce technology. -- -- This objective may include but is not limited to: 505.7.1.1. install a Windows Forms application on a client computer, -- 505.7.1.2. install a Windows Forms application from a server, -- 505.7.1.3. configure the required permissions of an application --
505.7.2. Install a Windows Presentation Foundation (WPF) browser application by using ClickOnce --
505.7.3. Install a Visual Studio Tools for Office (VSTO) application by using ClickOnce -- You can deploy Visual Studio Tools for Office solutions by using the Publish Wizard or by using the Publish page of the Project Designer. For information about the differences, see Publishing Office Solutions (2007 System). End users can install document-level customizations and application-level add-ins the following ways: * Running the Setup program that is created when you publish your solution. For information about the Setup program, see Publishing Office Solutions (2007 System). * Opening the deployment manifest file, which ends with the extension .vsto. * Opening a customized document or workbook, if the prerequisites are already installed and the security policy is set up to grant trust to the solution.
505.7.4. Configure and work with Windows Vista User Account Control (UAC) by using ClickOnce deployments --
505.7.5. Create a Windows Forms setup application. -- -- This objective may include but is not limited to: 505.7.5.1. configure setup project to add icons during setup, -- 505.7.5.2. set deployment project properties, -- 505.7.5.3. configure conditional installation based on operating system versions, -- 505.7.5.4. set appropriate Launch Conditions based on the .NET Framework version, -- 505.7.5.5. add custom actions to a setup project, -- 505.7.5.6. add error-handling code to a setup project --
505.7.6. Set appropriate security permissions to deploy the application. -- -- This objective may include but is not limited to: 505.7.6.1. elevated permissions --
505.7.7. Configure Trusted Application deployments -- You must follow these steps to take advantage of Trusted Application Deployment: 1. Obtain a certificate for the publisher. 2. Add the publisher to the trusted publishers store on all clients. 3. Create your ClickOnce application. 4. Sign the deployment manifest with the publisher's certificate. 5. Publish the application deployment to client computers.
505.7.8. Configure security features in an application. -- -- This objective may include but is not limited to: 505.7.8.1. Configure code access security, -- 505.7.8.2. configure the application to work with UAC, -- 505.7.8.3. configure Windows manipulation permissions, -- 505.7.8.4. configure appropriate file access permissions for the application, -- 505.7.8.5. control printing security for the application -- Part III of Larry West's Study Guide for 70:505: TS: Microsoft .NET Framework 3.5, Windows Forms Application Development505.3.0 Implementing Printing and Reporting Functionality in a Windows Forms Application -- 505.3.1. Manage the print process by using print dialogs. -- -- This objective may include but is not limited to: 505.3.1.1. Configure print options at run time, -- 505.3.1.2. change printers attached to a user’s computer, -- 505.3.1.3. configure the PrintPreviewDialog control, -- 505.3.1.4. set page details for printing by using the PageSetupDialog --
505.3.2. Construct print documents. -- -- This objective may include but is not limited to: 505.3.2.1. Configure the PrintDocument component, -- 505.3.2.2. print a text document in a Windows form, -- 505.3.2.3. print graphics in a Windows form, -- 505.3.2.4. print a document by using the PrintDialog component, -- 505.3.2.5. alert users to the completion of a print job --
505.3.3. Enable security features for printing in a Windows Forms application --
505.3.4. Create a customized PrintPreview component. -- -- This objective may include but is not limited to: 505.3.4.1. setting the Document property to establish the document to be previewed, -- 505.3.4.2. set Columns and Row properties, -- 505.3.4.3. set the UseAntiAlias property for smoother text, -- 505.3.4.4. configure zoom settings, -- 505.3.4.5. set StartPage property, -- 505.3.4.6. add custom methods and events to a PrintPreview control --
505.4.0 Enhancing Usability -- 505.4.1. Perform drag and drop operations. -- -- This objective may include but is not limited to: 505.4.1.1 perform drag and drop within an application and across applications, -- 505.4.1.2. perform drag and drop by using the Treeview control --
505.4.2. Implement globalization and localization for a Windows Forms application. -- -- This objective may include but is not limited to: 505.4.2.1. work with resource files for localization, -- 505.4.2.2. determine installed locales --
505.4.3. Implement accessibility features --
505.4.4. Create and configure multiple-document interface (MDI) forms. -- -- This objective may include but is not limited to: 505.4.4.1. create parent and child forms, -- 505.4.4.2. identify active child form, -- 505.4.4.3. send data to an active child form, -- 505.4.4.4. arrange child forms, -- 505.4.4.5. create menus for an MDI application --
505.4.5. Create, configure, and customize user assistance controls and components. -- -- This objective may include but is not limited to: 505.4.5.1. Configure the PropertyGrid component, -- To use the property grid, you create a new instance of the PropertyGrid class on a parent control and set SelectedObject to the object to display the properties for. The information displayed in the grid is a snapshot of the properties at the time the object is assigned. If a property value of the object specified by the SelectedObject is changed in code at run time, the new value is not displayed until an action is taken in the grid that causes the grid to refresh. The property tabs within the property grid appear as buttons on the toolbar at the top of the PropertyGrid, and can vary in scope as defined in the PropertyTabScope. The PropertyGrid control is not initially presented in the toolbox in the development environment. You can add a property grid to the toolbox (From the Tools menu, select Customize Toolbox. In the dialog box, select the Framework Components tab and then select PropertyGrid.), which enables you to drag a PropertyGrid onto your form. You can also define an instance of PropertyGrid by adding the appropriate code in your source code. All public properties of the SelectedObject will be displayed in the PropertyGrid by default. You can hide a property so that it is not displayed in the PropertyGrid control by decorating it with the BrowsableAttribute and setting the value to false. You can specify the category that a property appears in by providing a category with the CategoryAttribute. You can provide descriptive text for your property that appears at the bottom of the PropertyGrid control by using the DescriptionAttribute. 505.4.5.2. configure the ProgressBar control, -- A ProgressBar control visually indicates the progress of a lengthy operation in one of three styles: * Segmented blocks that increase in steps from left to right. * A continuous bar that fills in from left to right. * A block that scrolls across a ProgressBar in a marquee fashion. The Style property determines the style of ProgressBar that is displayed. Note that the ProgressBar control can only be oriented horizontally. For an example of how to create a vertically oriented ProgressBar, see the ProgressBarRenderer class. The ProgressBar control is typically used when an application performs tasks such as copying files or printing documents. Users of an application might consider an application unresponsive if there is no visual cue. By using the ProgressBar in your application, you alert the user that the application is performing a lengthy task and that the application is still responding. The Maximum and Minimum properties define the range of values to represent the progress of a task. The Minimum property is typically set to a value of 0, and the Maximum property is typically set to a value indicating the completion of a task. For example, to properly display the progress when copying a group of files, the Maximum property could be set to the total number of files to be copied. The Value property represents the progress that the application has made toward completing the operation. The value displayed by the ProgressBar only approximates the current value of the Value property. Based on the size of the ProgressBar, the Value property determines when to display the next block or increase the size of the bar. There are a number of ways to modify the value displayed by the ProgressBar other than changing the Value property directly. You can use the Step property to specify a specific value to increment the Value property by, and then call the PerformStep method to increment the value. To vary the increment value, you can use the Increment method and specify a value with which to increment the Value property. 505.4.5.3. configure StatusStrip, -- StatusStrip, used on forms as an area, usually displayed at the bottom of a window, in which an application can display various kinds of status information, replaces the StatusBar control. Special features of StatusStrip include a custom table layout, support for the form's sizing and moving grips, and support for the Spring property, which allows a ToolStripStatusLabel to fill available space automatically. The following items are specifically designed to work seamlessly with both ToolStripSystemRenderer and ToolStripProfessionalRenderer in all orientations. They are available by default at design time for the StatusStrip control: * ToolStripStatusLabel * ToolStripDropDownButton * ToolStripSplitButton * ToolStripProgressBar A StatusStrip control displays information about an object being viewed on a Form, the object's components, or contextual information that relates to that object's operation within your application. Typically, a StatusStrip control consists of ToolStripStatusLabel objects, each of which displays text, an icon, or both. The StatusStrip can also contain ToolStripDropDownButton, ToolStripSplitButton, and ToolStripProgressBar controls. The default StatusStrip has no panels. To add panels to a StatusStrip, use the ToolStripItemCollection..::.AddRange method, or use the StatusStrip Items Collection Editor at design time to add, remove, or reorder items and modify properties. Use the StatusStrip Tasks Dialog Box at design time to run common commands. Although StatusStrip replaces and extends the StatusBar control of previous versions, StatusBar is retained for both backward compatibility and future use if you choose. 505.4.5.4. configure ToolTip, -- With the ToolTip class, you can provide hints to a user when the user places the pointer on a control. The ToolTip class is typically used to alert users to the intended use of a control. For example, you can specify ToolTip text for a TextBox control that accepts a name, specifying the format of the name to be typed into the control. In addition to providing hints, you can also use the ToolTip class to provide run time status information. For example, you can use the ToolTip class to display connection speed and line quality data when the user moves the pointer onto a PictureBox control that displays Internet connection status. The ToolTip class can be used in any container. To explicitly specify a container, use the ToolTip(IContainer) constructor. A single ToolTip component typically is used to create ToolTips for multiple controls on a single form. After you create a ToolTip, use a separate call to the SetToolTip method to associate ToolTip display text to an individual control. Then when the user moves the pointer on a control, the ToolTip with its text is displayed. You can call SetToolTip more than once for the same control to change the text that is associated with the control. To get the text that is associated with a control, use the GetToolTip method. To remove all ToolTip text associations with an instance of the ToolTip class, use the RemoveAll method. 505.4.5.5. configure ErrorProvider, -- ErrorProvider presents a simple mechanism for indicating to the end user that a control on a form has an error associated with it. If an error description string is specified for the control, an icon appears next to the control. The icon flashes in the manner specified by BlinkStyle, at the rate specified by BlinkRate. When the mouse hovers over the icon, a ToolTip appears showing the error description string. Typically, you use ErrorProvider in association with data-bound controls. When using ErrorProvider with data-bound controls, you must specify the ContainerControl, either in the constructor or by setting the ContainerControl property. 505.4.5.6. configure HelpProvider controls, -- Each instance of HelpProvider maintains a collection of references to controls associated with it. To associate a Help file with the HelpProvider, set the HelpNamespace property. You specify the type of Help provided by calling the SetHelpNavigator method and providing a HelpNavigator value for the specified control. You provide the keyword or topic for the Help by calling the SetHelpKeyword method. To open Help to a specific topic, the keyword should be passed in the form topicName.htm. To associate a specific Help string with a control, use the SetHelpString method. The string that you associate with a control using this method is displayed in a pop-up window when the user presses the F1 key while the control has focus. If the HelpNamespace property has not been set, you must use the SetHelpString method to provide the Help text. If you have set both HelpNamespace and the Help string, Help based on the HelpNamespace will take precedence. HelpProvider calls methods on the Help class to provide Help functionality. 505.4.5.7. configure timer components -- The Timer component is a server-based timer, which allows you to specify a recurring interval at which the Elapsed event is raised in your application. You can then handle this event to provide regular processing. For example, suppose you have a critical server that must be kept running 24 hours a day, 7 days a week. You could create a service that uses a Timer to periodically check the server and ensure that the system is up and running. If the system is not responding, the service could attempt to restart the server or notify an administrator. The server-based Timer is designed for use with worker threads in a multithreaded environment. Server timers can move among threads to handle the raised Elapsed event, resulting in more accuracy than Windows timers in raising the event on time. For more information on server-based timers, see Introduction to Server-Based Timers. The Timer component raises the Elapsed event, based on the value of the Interval property. You can handle this event to perform the processing you need. For example, suppose that you have an online sales application that continuously posts sales orders to a database. The service that compiles the instructions for shipping operates on a batch of orders rather than processing each order individually. You could use a Timer to start the batch processing every 30 minutes. * A Timer [class] is used to raise an event at user-defined intervals. This Windows timer is designed for a single-threaded environment where UI threads are used to perform processing. It requires that the user code have a UI message pump available and always operate from the same thread, or marshal the call onto another thread. When you use this timer, use the Tick event to perform a polling operation or to display a splash screen for a specified period of time. Whenever the Enabled property is set to true and the Interval property is greater than zero, the Tick event is raised at intervals based on the Interval property setting. This class provides methods to set the interval, and to start and stop the timer. 505.4.6. Persist Windows Forms application settings between sessions -- The Application Settings feature of Windows Forms makes it easy to create, store, and maintain custom application and user preferences on the client computer. With Windows Forms application settings, you can store not only application data such as database connection strings, but also user-specific data, such as user application preferences. Using Visual Studio or custom managed code, you can create new settings, read them from and write them to disk, bind them to properties on your forms, and validate settings data prior to loading and saving.
505.5.0. Implementing Asynchronous Programming Techniques to Improve the User Experience -- 505.5.1. Manage a background process by using the BackgroundWorker component. -- The BackgroundWorker class allows you to run an operation on a separate, dedicated thread. Time-consuming operations like downloads and database transactions can cause your user interface (UI) to seem as though it has stopped responding while they are running. When you want a responsive UI and you are faced with long delays associated with such operations, the BackgroundWorker class provides a convenient solution. To execute a time-consuming operation in the background, create a BackgroundWorker and listen for events that report the progress of your operation and signal when your operation is finished. You can create the BackgroundWorker programmatically or you can drag it onto your form from the Components tab of the Toolbox. If you create the BackgroundWorker in the Windows Forms Designer, it will appear in the Component Tray, and its properties will be displayed in the Properties window. -- This objective may include but is not limited to: 505.5.1.1. Run a background process, -- To set up for a background operation, add an event handler for the DoWork event. Call your time-consuming operation in this event handler. To start the operation, call RunWorkerAsync. 505.5.1.2. announce completion of a background process, -- To receive a notification when the operation is completed, handle the BackgroundWorker.RunWorkerCompleted event. 505.5.1.3. cancel a background process, -- BackgroundWorker.CancelAsync requests cancellation of a pending background operation. 505.5.1.4. report on the progress of a background component, -- To receive notifications of progress updates, handle the BackgroundWorker.ProgressChanged event. 505.5.1.5. request status of a background component -- If you need the background operation to report on its progress, you can call the ReportProgress method to raise the ProgressChanged event. The WorkerReportsProgress property value must be true, or ReportProgress will throw an InvalidOperationException. It is up to you to implement a meaningful way of measuring your background operation's progress as a percentage of the total task completed.
505.5.2. Change the appearance of a UI element by using triggers. -- -- This objective may include but is not limited to: 505.5.2.1. using multiple triggers; -- 505.5.2.2. using property triggers; -- 505.5.2.3. using event triggers; -- 505.5.2.4. using data triggers --
505.5.3. Implement an asynchronous method. -- -- This objective may include but is not limited to: 505.5.3.1. Create an asynchronous method, -- 505.5.3.2. create a new process thread, -- 505.5.3.3. implement advanced asynchronous techniques --
Part II of Larry West’s Study Guide for Exam 70-505: TS: Microsoft .NET Framework 3.5, Windows Forms App. Dev.505.2.0 Integrating Data in a Windows Forms Application -- 505.2.1. Implement data-bound controls. -- -- This objective may include but is not limited to: 505.2.1.1. Use the DataGridView control to display and update the tabular data contained in a data source, -- The DataGridView control provides a customizable table for displaying data. The DataGridView class allows customization of cells, rows, columns, and borders through the use of properties such as DefaultCellStyle, ColumnHeadersDefaultCellStyle, CellBorderStyle, and GridColor. For more information, see Basic Formatting and Styling in the Windows Forms DataGridView Control. You can use a DataGridView control to display data with or without an underlying data source. Without specifying a data source, you can create columns and rows that contain data and add them directly to the DataGridView using the Rows and Columns properties. You can also use the Rows collection to access DataGridViewRow objects and the DataGridViewRow..::.Cells property to read or write cell values directly. The Item indexer also provides direct access to cells. As an alternative to populating the control manually, you can set the DataSource and DataMember properties to bind the DataGridView to a data source and automatically populate it with data. For more information, see Displaying Data in the Windows Forms DataGridView Control. When working with very large amounts of data, you can set the VirtualMode property to true to display a subset of the available data. Virtual mode requires the implementation of a data cache from which the DataGridView control is populated. For more information, see Data Display Modes in the Windows Forms DataGridView Control. For additional information about the features available in the DataGridView control, see DataGridView Control (Windows Forms). The following provides direct links to common tasks. How to: Add ToolTips to Individual Cells in a Windows Forms DataGridView Control , How to: Bind Data to the Windows Forms DataGridView Control , How to: Bind Data to the Windows Forms DataGridView Control Using the Designer , How to: Change the Type of a Windows Forms DataGridView Column Using the Designer , How to: Customize Data Formatting in the Windows Forms DataGridView Control , How to: Format Data in the Windows Forms DataGridView Control , How to: Set Default Cell Styles and Data Formats for the Windows Forms DataGridView Control Using the Designer , How to: Set Font and Color Styles in the Windows Forms DataGridView Control , Walkthrough: Creating a Master/Detail Form Using Two Windows Forms DataGridView Controls , Walkthrough: Validating Data in the Windows Forms DataGridView Control. Although the DataGridView control replaces and adds functionality to the DataGrid control of previous versions, the DataGrid control is retained for both backward compatibility and future use if you choose. For more information, see Differences Between the Windows Forms DataGridView and DataGrid Controls. The DataGridView control inherits both the ContextMenu and ContextMenuStrip properties from Control, but supports only the ContextMenuStrip property. Using the ContextMenu property with the DataGridView control has no effect. 505.2.1.2. use a simple data-bound control to display a single data element on a Windows Form, -- 505.2.1.3. implement complex data binding to integrate data from multiple sources, -- 505.2.1.4. navigate forward and backward through records in a DataSet in Windows Forms, -- 505.2.1.5. define a data source by using a DataConnector component, -- 505.2.1.6. create data forms by using the Data Form Wizard --
505.2.2. Manage connections and transactions. -- -- This objective may include but is not limited to: 505.2.2.1. Configure a connection to a database by using the Connection Wizard, -- 505.2.2.2. configure a connection to a database by using Server Explorer, -- 505.2.2.3. configure a connection to a database by using the Connection class, -- 505.2.2.4. connect to a database by using specific database Connection objects, -- 505.2.2.5. handle exceptions when connecting to a database, -- 505.2.2.6. perform transactions by using the Transaction object --
505.2.3. Create, add, delete, and edit data in a connected environment. -- -- This objective may include but is not limited to: 505.2.3.1. Retrieve data by using a DataReader object, -- 505.2.3.2. build SQL commands in Server Explorer, -- 505.2.3.3. build SQL commands in code, -- 505.2.3.4. create parameters for a Command object, -- 505.2.3.5. perform database operations by using a Command object, -- 505.2.3.6. retrieve data from a database by using a Command object, -- 505.2.3.7. perform asynchronous operations by using a Command object --
505.2.4. Query data from data sources by using LINQ -- -- This objective may include but is not limited to: 505.2.4.1. LINQ to SQL, -- LINQ to SQL provides a runtime infrastructure for managing relational data as objects without losing the ability to query. Your application is free to manipulate the objects while LINQ to SQL stays in the background tracking your changes automatically. 505.2.4.2. LINQ to Objects, -- 505.2.4.3. LINQ to Microsoft ADO.NET, -- The .NET Client library supports data service queries using language-integrated queries (LINQ) in addition to querying a data service in a call to 505.2.4.4. LINQ to XML -- .NET Language-Integrated Query for XML (LINQ to XML) allows XML data to be queried by using the standard query operators as well as tree-specific operators that provide XPath-like navigation through descendants, ancestors, and siblings. It provides an efficient in-memory representation for XML that integrates with the existing System.Xml reader/writer infrastructure and is easier to use than W3C DOM. There are three types that do most of the work of integrating XML with queries: XName, XElement and XAttribute.
505.2.5. Create, add, delete, and edit data in a disconnected environment. -- -- This objective may include but is not limited to: 505.2.5.1. Create a DataSet graphically, -- 505.2.5.2. create a DataSet programmatically, -- 505.2.5.3. add a DataTable to a DataSet, -- 505.2.5.4. add a relationship between tables within a DataSet, -- 505.2.5.5. navigate a relationship between tables, -- 505.2.5.6. merge DataSet contents, -- 505.2.5.7. copy DataSet contents, -- 505.2.5.8. create a typed DataSet, create DataTables, -- 505.2.5.9. manage data within a DataTable, -- 505.2.5.10. create and use DataViews, -- 505.2.5.11. represent data in a DataSet by using XML, -- 505.2.5.12. use the OleDbDataAdapter object to access an ADO Recordset or Record, -- 505.2.5.13. generate DataAdapter commands automatically by using the CommandBuilder object, -- 505.2.5.14. generate DataAdapter commands programmatically, -- 505.2.5.15. populate a DataSet by using a DataAdapter, -- 505.2.5.16. update a database by using a DataAdapter, -- 505.2.5.17. resolve conflicts between a DataSet and a database by using a DataAdapter, -- 505.2.5.18. respond to changes made to data at the data source by using DataAdapter events, -- 505.2.5.19. perform batch operations by using DataAdapters --
505.2.6. Manage XML by using the XML Document Object Model (DOM). -- -- This objective may include but is not limited to: 505.2.6.1. Read XML data into the DOM, -- 505.2.6.2. modify an XML document by adding and removing nodes, -- 505.2.6.3. modify nodes, -- 505.2.6.4. write data in an XML format by using the DOM, handle DOM events --
505.2.7. Read, write, and validate XML by using the XmlReader class and the XmlWriter class. -- -- This objective may include but is not limited to: 505.2.7.1. read XML data, -- 505.2.7.2. elements, -- 505.2.7.3. and attributes, -- 505.2.7.3. read specific elements or attributes, -- 505.2.7.4. use XmlTextReader, -- XmlTextReader Class represents a reader that provides fast, non-cached, forward-only access to XML data. In the .NET Framework version 2.0 release, the recommended practice is to create XmlReader instances using the XmlReader..::.Create method. This allows you to take full advantage of the new features introduced in this release. For more information, see Creating XML Readers. XmlTextReader provides forward-only, read-only access to a stream of XML data. The current node refers to the node on which the reader is positioned. The reader is advanced using any of the read methods and properties reflect the value of the current node. This class implements XmlReader and conforms to the W3C Extensible Markup Language (XML) 1.0 and the Namespaces in XML recommendations. XmlTextReader provides the following functionality: * Enforces the rules of well-formed XML. * XmlTextReader does not provide data validation. * Checks that DocumentType nodes are well-formed. XmlTextReader checks the DTD for well-formedness, but does not validate using the DTD. For nodes where NodeType is XmlNodeType.EntityReference, a single empty EntityReference node is returned (that is, the Value property is String.Empty). The actual declarations of entities in the DTD are called Entity nodes. When you refer to these nodes in your data, they are called EntityReference nodes. * Does not expand default attributes. Because the XmlTextReader does not perform the extra checks required for data validation, it provides a fast well-formedness parser. To perform data validation, use a validating XmlReader. For more information, see Validating XML Data with XmlReader. To read XML data from an XmlDocument, use XmlNodeReader. XmlTextReader throws an XmlException on XML parse errors. After an exception is thrown the state of the reader is not predictable. For example, the reported node type may be different than the actual node type of the current node. Use the ReadState property to check whether a reader is in error state. For further discussion on the XmlReader classes, see Reading XML with the XmlReader. Security Considerations The following are things to consider when using the XmlTextReader class. * Exceptions thrown the XmlTextReader can disclose path information that you do not want bubbled up to the application. Your applications must catch exceptions and process them appropriately. * DTD processing is enabled by default. Disable DTD processing if you are concerned about Denial of Service issues or if you are dealing with untrusted sources. Set the ProhibitDtd property to true to disable DTD processing. If you have DTD processing enabled, you can use the XmlSecureResolver to restrict the resources that the XmlTextReader can access. You can also design your application so that the XML processing is memory and time constrained. For example, configure time-out limits in your ASP.NET application. * XML data can include references to external resources such as a DTD file. By default external resources are resolved using an XmlUrlResolver object with no user credentials. You can secure this further by doing one of the following: * Restrict the resources that the XmlTextReader can access by setting the XmlResolver property to an XmlSecureResolver object. * Do not allow the XmlReader to open any external resources by setting the XmlResolver property to a null reference (Nothing in Visual Basic). * XML data can contain a large number of attributes, namespace declarations, nested elements and so on that require a substantial amount of time to process. To limit the size of the input that is sent to the XmlTextReader, create a custom IStream implementation and supply it the XmlTextReader. * The ReadValueChunk method can be used to handle large streams of data. This method reads a small number of characters at a time instead of allocating a single string for the whole value. * By default general entities are not expanded. General entities are expanded when you call the ResolveEntity method. 505.2.7.5. XmlNodeReader, -- XmlNodeReader Class represents a reader that provides fast, non-cached forward only access to XML data in an XmlNode. In the .NET Framework version 2.0, the recommended practice is to create XmlReader instances using the XmlReaderSettings class and the Create method. This allows you to take full advantage of all the new features introduced in the .NET Framework. For more information, see Creating XML Readers. The XmlNodeReader has the ability to read an XML DOM subtree. This class does not support document type definition (DTD) or schema validation. To perform data validation, use a validating XmlReader object. For further discussion on the XmlReader classes, see Reading XML with the XmlReader. 505.2.7.6. XmlValidatingReader, -- XmlValidatingReader Class represents a reader that provides document type definition (DTD), XML-Data Reduced (XDR) schema, and XML Schema definition language (XSD) validation. NOTE: This API is now obsolete. XmlValidatingReader implements the XmlReader class and provides support for data validation. Use the Schemas property to have the reader validate by using schema files that are cached in an XmlSchemaCollection. The ValidationType property specifies what type of validation the reader should perform. Setting the property to ValidationType.None creates a non-validating reader. XmlValidatingReader throws an XmlException on XML parse errors. After an exception is thrown the state of the reader is not predictable. For example, the reported node type may be different than the actual node type of the current node. Use the ReadState property to check whether a reader is in error state. The XmlValidatingReader class is obsolete in .NET Framework version 2.0. You can create a validating XmlReader instance by using the XmlReaderSettings class and the Create method. For more information, see Validating XML Data with XmlReader. 505.2.7.7 and XmlWriter classes -- XmlWriter Class represents a writer that provides a fast, non-cached, forward-only means of generating streams or files containing XML data. Although the Microsoft .NET Framework includes the XmlTextWriter class, which is an implementation of the XmlWriter class, in the 2.0 release, it is recommended that you use the Create method to create new XmlWriter objects. The Create method allows you to specify the features to support on the created XmlWriter object, and it also allows you to take full advantage of the new features introduced in the 2.0 release. When you use the XmlWriter methods to output XML, the elements and attributes will not be written until you call the Close method. For example, if you are using the XmlWriter to populate an XmlDocument, until you close the XmlWriter, you will not be able to observe the written elements and attributes in the target document. For more information about the XmlWriter class, see Writing XML with the XmlWriter. Part I of Larry West’s Study Guide for Exam 70-505: TS: Microsoft .NET Framework 3.5, Windows Forms App. Dev.This is a work in progress to help me (and now you) to study for the 70-505 exam: I had to split it up because Spaces has such a tiny limit on the maximum amount of text one can have.
Skills Being Measured This exam measures your ability to accomplish the technical tasks listed below. 505.1.0.. Creating a UI for a Windows Forms Application by Using Standard Controls -- 505.1.1 Add and configure a Windows Form. -- -- This objective may include but is not limited to: 505.1.1.1. Add a Windows Form to a project at design time. -- 505.1.1.2. Configure a Windows Form to control accessibility, -- 505.1.1.3. appearance, -- 505.1.1.4. behavior, -- 505.1.1.5. configuration, -- 505.1.1.6. data, -- 505.1.1.7. design, -- 505.1.1.8. focus, -- 505.1.1.9. layout, -- 505.1.1.10. style, and other functionality --
505.1.2. Manage control layout on a Windows Form. -- -- This objective may include but is not limited to: 505.1.2.1. Group and arrange controls by using the Panel control, -- Content Model: Panel enforces a strong content model for child content. The Children collection of a Panel element can only consist of UIElement objects. Adding a UIElement child to a Panel implicitly adds it to the UIElementCollection for the Panel element. WPF provides a comprehensive suite of derived Panel implementations, enabling many complex layouts. If you want to implement new layout containers, use the MeasureOverride and ArrangeOverride methods. For a demonstration of how to use these methods, see Create a Custom Content-Wrapping Panel Sample. Panel elements do not receive mouse or stylus events if a Background is not defined. If you need to handle mouse or stylus events but do not want a background for your Panel, use Transparent. Panel elements do not receive focus by default. To compel a panel element to receive focus, set the Focusable property to true. 505.1.2.2. GroupBox control, -- Content Model: GroupBox is a HeaderedContentControl. Its content property is Content and its header property is Header. For more information on the content model for GroupBox, see Controls Content Model Overview. For a complete sample, see GroupBox Sample. 505.1.2.3. TabControl control, -- The TabControl is useful for minimizing screen space usage while allowing an application to expose a large amount of data. A TabControl consists of multiple TabItem objects that share the same screen space. Only one TabItem in a TabControl is visible at a time. When a user selects the tab of a TabItem, the contents of that TabItem become visible and the contents of the other TabItem objects are hidden. Content Model: TabControl is a ItemsControl. Its content properties are Items and ItemsSource. For more information on the content model for TabControl, see Controls Content Model Overview. 505.1.2.4. FlowLayoutPanel control, -- The FlowLayoutPanel control arranges its contents in a horizontal or vertical flow direction. Its contents can be wrapped from one row to the next, or from one column to the next. Alternatively, its contents can be clipped instead of wrapped. You can specify the flow direction by setting the value of the FlowDirection property. The FlowLayoutPanel control correctly reverses its flow direction in right-to-left (RTL) layouts. You can also specify whether the contents of the FlowLayoutPanel control are wrapped or clipped by setting the value of the WrapContents property. Any Windows Forms control, including other instances of FlowLayoutPanel, can be a child of the FlowLayoutPanel control. With this capability, you can construct sophisticated layouts that adapt to your form's dimensions at run time. Docking and anchoring behaviors of child controls differ from the behaviors in other container controls. Both docking and anchoring are relative to the largest control in the flow direction. For more information, see How to: Anchor and Dock Child Controls in a FlowLayoutPanel Control. 505.1.2.5. and TableLayoutPanel control -- The TableLayoutPanel control arranges its contents in a grid. Because the layout is performed both at design time and run time, it can change dynamically as the application environment changes. This gives the controls in the panel the ability to proportionally resize, so it can respond to changes such as the parent control resizing or text length changing due to localization. Any Windows Forms control can be a child of the TableLayoutPanel control, including other instances of TableLayoutPanel. This allows you to construct sophisticated layouts that adapt to changes at runtime. The TableLayoutPanel control can expand to accommodate new controls when they are added, depending on the value of the RowCount, ColumnCount, and GrowStyle properties. Setting either the RowCount or ColumnCount property to a value of 0 specifies that the TableLayoutPanel will be unbound in the corresponding direction. You can also control the direction of expansion (horizontal or vertical) after the TableLayoutPanel control is full of child controls. By default, the TableLayoutPanel control expands downward by adding rows. If you want rows and columns that behave differently from the default behavior, you can control the properties of rows and columns by using the RowStyles and ColumnStyles properties. You can set the properties of rows or columns individually. The TableLayoutPanel control adds the following properties to its child controls: Cell, Column, Row, ColumnSpan, and RowSpan. You can merge cells in the TableLayoutPanel control by setting the ColumnSpan or RowSpan properties on a child control. To set the Cell, Column, Row, ColumnSpan, and RowSpan properties at run time, use the SetCellPosition(), SetColumn(), SetRow(), SetColumnSpan(), and SetRowSpan() methods. To read the Cell , Column , Row , ColumnSpan , and RowSpan properties at run time, use the GetCellPosition() , GetColumn() , GetRow() , GetColumnSpan() , and GetRowSpan() methods. The docking behavior of child controls is the same as other container controls. The anchoring behavior of child controls in a TableLayoutPanel differs from the behavior in other container controls. If the value of the child control's Anchor property is set to Left or Right, the control will be placed against the left or right border of the cell, at a distance that is the sum of the control's Margin property and the panel's Padding property. If both the Left and Right values are set, the control will be sized to the width of the cell, with the Margin and Padding values taken into account. The behavior for Top and Bottom anchoring is analogous. For more information, see How to: Anchor and Dock Child Controls in a TableLayoutPanel Control. If you need a child control to mimic the default anchoring behavior in other container controls, you can adjust the Margin and Padding properties to maintain a constant distance between the control's border and the cell's border. Setting the values of both the Column and Row properties of a child control to -1 will cause the control to be moved to the first empty cell in the TableLayoutPanel control. The empty cell will be chosen in a search that proceeds from left to right and from top to bottom. This order is dependent on the culture, so it will behave correctly in right-to-left (RTL) layouts. See also How to: Align and Stretch a Control in a TableLayoutPanel Control, How to: Edit Columns and Rows in a TableLayoutPanel Control, How to: Span Rows and Columns in a TableLayoutPanel Control, and Walkthrough: Arranging Controls on Windows Forms Using a TableLayoutPanel.
505.1.3 Add and configure a Windows Forms control. -- -- This objective may include but is not limited to: 505.1.3.1. Use the integrated development environment (IDE) to add a control to a Windows Form or other container control of a project at design time, -- 505.1.3.2. add controls to a Windows Form at run time, -- 505.1.3.3. configure controls on a Windows Form at design time to optimize the UI, -- 505.1.3.4. modify control properties --
505.1.4 Create and configure menus. -- -- This objective may include but is not limited to: 505.1.4.1. Create and configure a MenuStrip component on a Windows Form, -- MenuStrip is the top-level container that supersedes MainMenu. It also provides key handling and multiple document interface (MDI) features. Functionally, ToolStripDropDownItem and ToolStripMenuItem work along with MenuStrip, although they are derived from ToolStripItem. The following items are specifically designed to work seamlessly with both ToolStripSystemRenderer and ToolStripProfessionalRenderer in all orientations. They are available by default at design time for the MenuStrip control: * ToolStripMenuItem * ToolStripTextBox * ToolStripComboBox The MenuStrip control represents the container for the menu structure of a form. You can add ToolStripMenuItem objects to the MenuStrip that represent the individual menu commands in the menu structure. Each ToolStripMenuItem can be a command for your application or a parent menu for other submenu items. Although MenuStrip replaces and adds functionality to the MainMenu control of previous versions, MainMenu is retained for both backward compatibility and future use if you choose. 505.1.4.2. change the displayed menu structure programmatically, -- 505.1.4.3. create and configure the ContextMenuStrip component on a Windows Form -- ContextMenuStrip replaces ContextMenu. You can associate a ContextMenuStrip with any control, and a right mouse click automatically displays the shortcut menu. You can show a ContextMenuStrip programmatically by using the Show method. ContextMenuStrip supports cancelable Opening and Closing events to handle dynamic population and multiple-click scenarios. ContextMenuStrip supports images, menu-item check state, text, access keys, shortcuts, and cascading menus. The following items are specifically designed to work seamlessly with both ToolStripSystemRenderer and ToolStripProfessionalRenderer in all orientations. They are available by default at design time for the ContextMenuStrip control: * ToolStripMenuItem * ToolStripSeparator * ToolStripTextBox * ToolStripComboBox Shortcut menus are typically used to combine different menu items from a MenuStrip of a form that are useful for the user given the context of the application. For example, you can use a shortcut menu assigned to a TextBox control to provide menu items for changing the font of the text, finding text within the control, or Clipboard features for copying and pasting text. You can also expose new ToolStripMenuItem objects in a shortcut menu that are not located within a MenuStrip to provide situation-specific commands that are inappropriate for the MenuStrip to display. Typically, a shortcut menu is displayed when a user clicks the right mouse button over a control or the form itself. Many visible controls, as well as the Form itself, have a Control..::.ContextMenuStrip property that binds the ContextMenuStrip class to the control that displays the shortcut menu. More than one control can use a ContextMenuStrip. Set the ToolStripDropDownMenu..::.ShowCheckMargin property to true to add space to the left of a ToolStripMenuItem for a check mark that shows that the menu item is enabled or selected. The ToolStripDropDownMenu..::.ShowImageMargin property is set to true by default. Use this space to the left of the ToolStripMenuItem to display an image for that menu item. Although ContextMenuStrip replaces and adds functionality to the ContextMenu control of previous versions, ContextMenu is retained for both backward compatibility and future use if so desired.
505.1.5 Create event handlers for Windows Forms and controls. -- -- This objective may include but is not limited to: 505.1.5.1. Manage mouse and keyboard events within Windows Forms applications, -- 505.1.5.2. create event handlers at run time to respond to system or user events dynamically, -- 505.1.5.3. connect multiple events to a single event handler --
|
|
|