NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Retrieving Dialog Box Information Selectively Using Multiple Properties

A common way to process the information returned from a dialog box is to provide a set of properties that return individual elements of dialog box data. This way, you can selectively extract data from the dialog box.

If you have dialog box data that is related, consider exposing some information through objects. For details, see Retrieving Dialog Box Information Collectively Using Objects.

To expose dialog box information through properties

  1. Display the class for your dialog box in your code editor.
  2. Create as many properties as needed to expose the necessary information for your dialog box. Provide a return value that is appropriate for the type of data you are providing.
  3. Add code to the Get portion of the property definition. If you want to prevent a user from changing the dialog box information outside of the dialog box, remove the Set portion of the property definition.

    The following code demonstrates how to expose the value of a combo box through a property defined in a dialog box:

    [Visual Basic]
    Public Property Get StateSelected () as String
       StateSelected = cmbState.Text
    End Sub
    [C#]
    public string StateSelected {
       get{ return comboBox1.Text; }
    }

Once you have exposed properties for all of the data you want to provide, you can retrieve the data from the application that uses the dialog box.

To retrieve data from the properties of a dialog box

See Also

Dialog Boxes | How to Handle User Input to Dialog Boxes | Creating Dialog Boxes | Displaying Dialog Boxes for Win Forms | Closing Dialog Boxes and Retaining User Input | Retrieving the Result for Dialog Boxes | Retrieving Dialog Box Information Collectively Using Objects | Retrieving Information from the Parent Form of a Dialog Box