共用方式為


About Configuration Manager Console Forms

Applies To: System Center Configuration Manager 2007, System Center Configuration Manager 2007 R2, System Center Configuration Manager 2007 R3, System Center Configuration Manager 2007 SP1, System Center Configuration Manager 2007 SP2

You can extend the Microsoft System Center Configuration Manager 2007 console with new Windows forms. Specifically, you can add form-based dialog boxes and property sheets. A user accesses these forms from Configuration Manager 2007 actions that you define.

Note

Wizards are another Windows form that is used by the Configuration Manager console, but you cannot extend or add wizards by using the Configuration Manager console framework. You can, however, run your own wizard solution by using Configuration Manager actions. For more information, see Configuration Manager Console Wizards.

In Configuration Manager, forms are stored in .NET Framework assemblies that are called by the Configuration Manager console after the appropriate action is selected.

Creating an Extension Form

To write an extension form, you do the following:

  • Create the extension form assembly.

  • Create the extension form action XML.

  • Create the extension form property sheet XML.

Create the Extension Form Assembly

Property sheets

A property sheet is made up of one or more property pages that you define. You can also integrate property pages into existing Configuration Manager dialog boxes.

To create a property sheet, you create a Windows Control Library project in Visual Studio. In this project, you create a class that inherits from the SmsPageControl class. This class implements the control you want to display on a property page. In a property sheet, you create an SmsPageControl class for each property page that you need. You also create a further class inheriting from the SmsPropertyPage class. This class is called by the Configuration Manager console and loads the SmsPageControl class in a property page. The Dialog Prototype sample in the Configuration Manager SDK has a complete solution that you can use. For more information, see How to Create a Configuration Manager Property Sheet.

Dialog boxes

A dialog box in Configuration Manager is displayed like a typical modeless dialog box. You create a Windows Control Library project in Visual Studio and derive your dialog box class from SmsCustomDialog. For more information, see How to Create a Configuration Manager Dialog Box.

Create the Form Action XML

An action describes the type of extension that is called, and where the action is placed in the Configuration Manager console user interface. For an extension form, you use the ShowDialog action type to display the form. For more information, see How to Create Action XML for a Configuration Manager Property Sheet.

For more information about actions, see About Configuration Manager Console Actions.

Create the Form Property Sheet XML

Whether or not the form is a property sheet, the form has a property sheet XML file that defines the assembly, namespace, and type of the form. In property sheets, it defines the order of the property pages on the property sheet. There is a property sheet XML file for every Configuration Manager console form.

Note

The Configuration Manager console property sheet XML files are stored in %ProgramFiles%\Microsoft Configuration Manager\AdminUI\XmlStorage\Forms.

When you create a new form, you create a new property sheet XML file. If you are adding a new property page to an existing property sheet, you merge the property page XML with an existing property sheet XML file.

Note

Extension property sheets are stored in %ProgramFiles%\Microsoft Configuration Manager\AdminUI\XmlStorage\Extensions\Forms.

For more information about form XML deployment, see Configuration Manager Console Extension Deployment.

Depending on whether you are displaying a dialog box or a property sheet, the FormType attribute values must be set.

FormType Description

PropertySheet

The form is a property sheet.

CustomDialog

The form is a dialog box.

When an action is selected, the Configuration Manager console uses the property sheet XML to determine which assembly is needed to load and display the form.

For more information, see How to Create Form XML for a Configuration Manager Property Sheet.

Help

F1 Help

You can add F1 Help support to your forms by specifying the HelpID attribute of the form Page element. In the HelpID attribute you specify the path to the .chm file and to the topic you want to display in the following format:

HelpID="<path to chm>::<path to topic><topic name>.htm"

For example, the following Page declaration loads the "How to Create a Package" topic from the Configuration Manager 2007 .chm file. The .chm file is assumed to be in c:\chm.

<Page VendorId="My company" Id="{683A9258-A858-496c-833A-CCA7CCE6DDBB}" Type="ConfigMgrControlPage" HelpID="C:\chm\SystemCenterConfigurationManager_SDK.chm::/html/f41c0fa8-6bc8-4bbb-86ab-c30f673baf09.htm" />

For more information about using the Page element, see How to Create Form XML for a Configuration Manager Property Sheet and How to Create Form XML for a Configuration Manager Dialog Box.

Note

You cannot combine multiple .chm files for a given form.

Custom Help

You can also display your own .chm file outside of the F1 Help system. For example, you can add a button to your form that opens your Help .chm file. For more information about opening Help from Windows forms, see https://go.microsoft.com/fwlink/?LinkId=110511.

Managing Object Data in a Form

A Configuration Manager form can be passed custom data and also, from the results pane, the objects returned from a query. Selected objects from the results pane are made available to a form through a PropertyManager object. For more information, see How to Use Objects Passed to a Configuration Manager Form. You can bind a form control to objects passed in to the form's PropertyManager. For more information, see How to Bind Configuration Manager Data to a Form.

The Configuration Manager console serializes Configuration Manager objects passed into a form when the form is dismissed.

Queries

You can perform both synchronous and asynchronous queries in forms by using the managed SMS Provider. You get the QueryProcessor object from the form's PropertyManagerConnectionManager. After it is obtained, the code is identical to the SMS Provider examples. For an example of a synchronous query, see How to Perform a Synchronous Configuration Manager Query by Using Managed Code.

For an example of an asynchronous query, see How to Perform an Asynchronous Configuration Manager Query by Using Managed Code.

See Also

Concepts

How to Add a Property Page to an Existing Configuration Manager Property Sheet
How to Bind Configuration Manager Data to a Form
How to Create a Configuration Manager Property Sheet
How to Create Action XML for a Configuration Manager Dialog Box
How to Create Action XML for a Configuration Manager Property Sheet
How to Create a Configuration Manager Dialog Box
How to Create Form XML for a Configuration Manager Dialog Box
How to Create Form XML for a Configuration Manager Property Sheet
How to Use Objects Passed to a Configuration Manager Form