1.窗口靠边自动隐藏,如何实现?
VB的代码,自己看: 把这个存储为form1.frm VERSION 5.00 Begin VB.Form Form1 AutoRedraw = -1 'True Caption = "Animating Windows Demo" ClientHeight = 3240 ClientLeft = 60 ClientTop = 345 ClientWidth = 7425 LinkTopic = "Form1" ScaleHeight = 3240 ScaleWidth = 7425 StartUpPosition = 3 'Windows Default Begin VB.CommandButton Command10 Caption = "Roll Bottom to Top" Height = 495 Left = 5160 TabIndex = 9 Top = 2520 Width = 2055 End Begin VB.CommandButton Command9 Caption = "Roll Top to Bottom" Height = 495 Left = 5160 TabIndex = 8 Top = 1800 Width = 2055 End Begin VB.CommandButton Command8 Caption = "Roll Right to Left" Height = 495 Left = 5160 TabIndex = 7 Top = 1080 Width = 2055 End Begin VB.CommandButton Command7 Caption = "Roll Left to Right" Height = 495 Left = 5160 TabIndex = 6 Top = 360 Width = 2055 End Begin VB.CommandButton Command6 Caption = "Slide Bottom to Top" Height = 495 Left = 2640 TabIndex = 5 Top = 2520 Width = 2055 End Begin VB.CommandButton Command5 Caption = "Slide Top to Bottom" Height = 495 Left = 2640 TabIndex = 4 Top = 1800 Width = 2055 End Begin VB.CommandButton Command4 Caption = "Slide Right to Left" Height = 495 Left = 2640 TabIndex = 3 Top = 1080 Width = 2055 End Begin VB.CommandButton Command3 Caption = "Slide Left to Right" Height = 495 Left = 2640 TabIndex = 2 Top = 360 Width = 2055 End Begin VB.CommandButton Command2 Caption = "Blend and Hide" Height = 495 Left = 240 TabIndex = 1 Top = 1920 Width = 2055 End Begin VB.CommandButton Command1 Caption = "Collapse Inward" Height = 495 Left = 240 TabIndex = 0 Top = 1080 Width = 2055 End End Attribute VB_Name = "Form1" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Const AW_VER_POSITIVE = &H4 Const AW_HOR_NEGATIVE = &H2 Const AW_HOR_POSITIVE = &H1 Const AW_VER_NEGATIVE = &H8 Const AW_HIDE = &H10000 Const AW_SLIDE = &H40000 Const AW_BLEND = &H80000 Const AW_CENTER = &H10 Const BlendAndHide = AW_BLEND Or AW_HIDE Const SlideLeftToRight = AW_HOR_POSITIVE Or AW_SLIDE Or AW_HIDE Const SlideRightToLeft = AW_HOR_NEGATIVE Or AW_SLIDE Or AW_HIDE Const SlideTopToBottom = AW_VER_POSITIVE Or AW_SLIDE Or AW_HIDE Const SlideBottomToTop = AW_VER_NEGATIVE Or AW_SLIDE Or AW_HIDE Const RollLeftToRight = AW_HOR_POSITIVE Or AW_HIDE Const RollRightToLeft = AW_HOR_NEGATIVE Or AW_HIDE Const RollTopToBottom = AW_VER_POSITIVE Or AW_HIDE Const RollBottomToTop = AW_VER_NEGATIVE Or AW_HIDE Const CollapseInward = AW_CENTER Or AW_HIDE Private Declare Function AnimateWindow Lib "user32" (ByVal hwnd As Long, ByVal dwTime As Long, ByVal dwFlags As Long) As Boolean Private Sub Command1_Click() Load Form2 Form2.Show AnimateWindow Form2.hwnd, 600, CollapseInward Unload Form2 End Sub Private Sub Command10_Click() Load Form2 Form2.Show AnimateWindow Form2.hwnd, 600, RollBottomToTop Unload Form2 End Sub Private Sub Command2_Click() Load Form2 Form2.Show AnimateWindow Form2.hwnd, 600, BlendAndHide Unload Form2 End Sub Private Sub Command3_Click() Load Form2 Form2.Show AnimateWindow Form2.hwnd, 600, SlideLeftToRight Unload Form2 End Sub Private Sub Command4_Click() Load Form2 Form2.Show AnimateWindow Form2.hwnd, 600, SlideRightToLeft Unload Form2 End Sub Private Sub Command5_Click() Load Form2 Form2.Show AnimateWindow Form2.hwnd, 600, SlideTopToBottom Unload Form2 End Sub Private Sub Command6_Click() Load Form2 Form2.Show AnimateWindow Form2.hwnd, 600, SlideBottomToTop Unload Form2 End Sub Private Sub Command7_Click() Form2.Show AnimateWindow Form2.hwnd, 600, RollLeftToRight Unload Form2 End Sub Private Sub Command8_Click() Load Form2 Form2.Show AnimateWindow Form2.hwnd, 600, RollRightToLeft Unload Form2 End Sub Private Sub Command9_Click() Load Form2 Form2.Show AnimateWindow Form2.hwnd, 600, RollTopToBottom Unload Form2 End Sub Private Sub Form_Unload(Cancel As Integer) Unload Form2 End Sub ========================================== 添加一个form2 运行看看效果就知道了。
转载请注明出处windows之家 » win10系统怎么设置窗口拖动到边缘隐藏