ICreate.Controls.Bars Send comments on this topic.
DialogResult Property
See Also 
ICreate.Controls.Bars Namespace > CommandItem Class : DialogResult Property






Gets or sets the value returned to the parent Form when the CommandItem is clicked.

Syntax

Visual Basic (Declaration) 
Public Property DialogResult As DialogResult
Visual Basic (Usage)Copy Code
Dim instance As CommandItem
Dim value As DialogResult
 
instance.DialogResult = value
 
value = instance.DialogResult
C# 
public DialogResult DialogResult {get; set;}
Delphi 
public read-write property DialogResult: DialogResult; 
JScript 
public function get,set DialogResult : DialogResult
Managed Extensions for C++ 
public: __property DialogResult get_DialogResult();
public: __property void set_DialogResult( 
   DialogResult value
);
C++/CLI 
public:
property DialogResult DialogResult {
   DialogResult get();
   void set (DialogResult value);
}

Return Value

A DialogResult value, this property specifies the value the parent Form DialogResult property is set to when the CommandItem is clicked. The default value is None.

Remarks

If the value for this property is set to anything other than None and the parent Form displayed using the ShowDialog method, then clicking the CommandButon closes the parent Form without you having to hook up any events. The Form's DialogResult property is set to the DialogResult of the CommandItem clicked.

For example, to create a "Yes/No/Cancel" dialog box, simply add three buttons and set their DialogResult properties to Yes, No, and Cancel.

For more information see the IButtonControl interface.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also