`
yiyeqinghuasoon
  • 浏览: 644906 次
文章分类
社区版块
存档分类
最新评论

如何与Windows窗体进行交互

 
阅读更多

可以将 Windows 窗体添加到 Visual Studio Tools for Office 项目中,方法与在 Visual Studio 中的其他项目中添加 Windows 窗体相同。有关更多信息,请参见 Windows 窗体控件

显示 Windows 窗体

  1. 在项目中添加一个 Windows 窗体。在此示例中,Windows 窗体名为 ReportPicker

  2. 在项目的 Startup 事件处理程序中,创建一个新窗体实例,并调用 ShowDialog 方法以显示模式窗体。

    Visual Basic
    Dim reportPicker As New ReportPicker
    reportPicker.ShowDialog()
    
    C#
    ReportPicker reportPicker = new ReportPicker();
    reportPicker.ShowDialog();
    
    <!--src=[../icons/alert_note.gif]-->sxk5sx7f.alert_note(zh-cn,VS.90).gif说明:

    还可以使用 Show 方法来显示非模式窗体。

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics