IUIService.ShowDialog(Form) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
尝试在对话框中显示指定的窗体。
public:
System::Windows::Forms::DialogResult ShowDialog(System::Windows::Forms::Form ^ form);
public System.Windows.Forms.DialogResult ShowDialog (System.Windows.Forms.Form form);
abstract member ShowDialog : System.Windows.Forms.Form -> System.Windows.Forms.DialogResult
Public Function ShowDialog (form As Form) As DialogResult
参数
返回
DialogResult 值之一,指示由对话框返回的结果代码。
示例
下面的代码示例尝试获取 类的 IUIService 实例并调用服务的 ShowDialog 方法。
IUIService^ UIservice = dynamic_cast<IUIService^>(this->GetService( System::Windows::Forms::Design::IUIService::typeid ));
if ( UIservice != nullptr )
UIservice->ShowDialog( gcnew ExampleForm );
IUIService UIservice = (IUIService)this.GetService(
typeof( System.Windows.Forms.Design.IUIService ) );
if( UIservice != null )
UIservice.ShowDialog(new ExampleForm());
Dim UIservice As IUIService = CType(Me.GetService( _
GetType(System.Windows.Forms.Design.IUIService)), IUIService)
If (UIservice IsNot Nothing) Then
UIservice.ShowDialog(New ExampleForm())
End If