Life is long ......

继续向前 永不停止

   :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

创建 Windows 窗体

  1. 启动 Visual Studio。
  2. 创建名为 HelloWorld 的 Windows 应用程序。
  3. 将一个 Button 控件从“工具箱”中拖动到窗体上。
  4. 单击按钮将其选定。在“属性”窗口中,将 Text 属性设置为“Say Hello”。

编写应用程序的代码

  1. 双击该按钮,为 Button1 的 Click 事件添加事件处理程序。此时将打开代码编辑器,插入点已位于事件处理程序中。
  2. 插入下列代码:
    MessageBox.Show("Hello, World!");

测试应用程序

  1. F5 键运行该应用程序。
  2. 当正在运行应用程序时,单击该按钮并验证已显示“Hello, World!”。
  3. 关闭此 Windows 窗体并返回 Visual Studio编辑状态。
posted on 2006-04-17 00:53  patrickwai  阅读(1047)  评论(0编辑  收藏  举报