Winform窗体事件发生顺序
2016-05-27 16:16
316 查看
Form 和Control 类公开了一组与应用程序启动和关闭相关联的事件。当Windows 窗体应用程序启动时,主窗体的启动事件按以下顺序引发:
System.Windows.Forms.Control.HandleCreated 在为控件创建句柄时发生。
System.Windows.Forms.Control.BindingContextChanged 当 BindingContext 属性的值更改时发生。
System.Windows.Forms.Form.Load 在第一次显示窗体前发生。
System.Windows.Forms.Control.VisibleChanged 在 Visible 属性值更改时发生。
System.Windows.Forms.Form.Activated 当使用代码激活或用户激活窗体时发生。
System.Windows.Forms.Form.Shown 只要窗体是首次显示就发生。
当应用程序关闭时,主窗体的关闭事件按以下顺序引发:
System.Windows.Forms.Form.Closing 发生于表单正在关闭时
System.Windows.Forms.Form.FormClosing 关闭窗体前发生。
System.Windows.Forms.Form.Closed 关闭窗体
System.Windows.Forms.Form.FormClosed 关闭窗体后发生。
System.Windows.Forms.Form.Deactivate 当窗体失去焦点并不再是活动窗体时发生。
Application 类的ApplicationExit 事件在主窗体的关闭事件之后引发。
因此,如果你想让窗体在加载后自动隐藏,就应该把隐藏语句加在Shown里而不是Load。
相关文章推荐
- Java 比较两个字符串的大小
- SparkStreaming基于Kafka Direct
- 可变参数
- mongodb查看当前操作db.currentOp()
- linux中常用的一些命令
- C# SMTP 邮件发送之QQ邮箱篇
- static 全局变量 和 普通全局变量区别
- Eclipse SVN文件冲突及不能直接提交情况
- Oracle数据库用户、表、表空间之间关系
- IE6不支持fixed
- 读jQuery源码释疑笔记2
- 餐饮管理系统之员工管理
- 隐藏/修饰页面的滚动条
- 集成shareSDK3.3.0所遇到的问题
- JuheNews系列之二 · ToolBar+AppBarLayout+CoordinatorLayout+CollapsingToolbarLayout
- Android 学习路线总结
- 自行编写strcpy()函数
- 解决Grails端口号冲突问题
- Java中vector的使用详解
- 安卓Transition学习(一)