以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  [求助]窗体的关闭方式  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=77908)

--  作者:liuxianjie1980
--  发布时间:2015/11/27 16:02:00
--  [求助]窗体的关闭方式
窗体的关闭方式,如:模式窗口,就只有一种关闭方式吗?有没有其他的退出方式,比如翻转、百叶窗等。
--  作者:大红袍
--  发布时间:2015/11/27 18:02:00
--  

全局代码


<DllImport("user32.dll", EntryPoint := "AnimateWindow")> _
Public Function AnimateWindow(handle As IntPtr, ms As Integer, flags As Integer) As Boolean
End Function
Public Const AW_HOR_POSITIVE As Int32 = &H1
Public Const AW_HOR_NEGATIVE As Int32 = &H2
Public Const AW_VER_POSITIVE As Int32 = &H4
Public Const AW_VER_NEGATIVE As Int32 = &H8
Public Const AW_CENTER As Int32 = &H10
Public Const AW_HIDE As Int32 = &H10000
Public Const AW_ACTIVATE As Int32 = &H20000
Public Const AW_SLIDE As Int32 = &H40000
Public Const AW_BLEND As Int32 = &H80000

 

调用代码

 

e.Form.BaseForm.FormBorderStyle = Windows.Forms.FormBorderStyle.None
AnimateWindow(e.form.Baseform.Handle, 300, AW_HIDE + AW_CENTER)
e.form.Close

 

参考资料 http://www.cnblogs.com/KeenLeung/archive/2013/05/19/3087728.html