autohide.frm

来自「个人VB学习源码精选,自己学习时的一些编程小程序,希望对大家有帮助」· FRM 代码 · 共 50 行

FRM
50
字号
VERSION 5.00
Begin VB.Form AutoHide 
   BorderStyle     =   4  'Fixed ToolWindow
   Caption         =   "Form1"
   ClientHeight    =   3195
   ClientLeft      =   45
   ClientTop       =   285
   ClientWidth     =   4680
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   159.75
   ScaleMode       =   2  'Point
   ScaleWidth      =   234
   ShowInTaskbar   =   0   'False
   StartUpPosition =   3  '窗口缺省
   Begin VB.Timer Timer1 
      Interval        =   500
      Left            =   60
      Top             =   2760
   End
End
Attribute VB_Name = "AutoHide"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Declare Function GetCursorPos Lib "user32" (lpPoint As PointApi) As Long
Private Type PointApi
    x As Long
    y As Long
End Type
Dim Mouse As PointApi

Private Sub Form_Load()
    AutoHide.Height = Screen.Height
    AutoHide.Top = 0
    AutoHide.Left = (0 - AutoHide.Width) + 50
End Sub

Private Sub Timer1_Timer()
    a = GetCursorPos(Mouse)
    If Mouse.x = 0 Then
        AutoHide.Left = 0
    End If
    If Mouse.x > AutoHide.ScaleWidth Then
        AutoHide.Left = (0 - AutoHide.Width) + 50
    End If
End Sub

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?