⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 osen xp form.ctl

📁 用vb编写的工程控制程序
💻 CTL
📖 第 1 页 / 共 4 页
字号:
VERSION 5.00
Begin VB.UserControl OsenXPForm 
   Appearance      =   0  'Flat
   AutoRedraw      =   -1  'True
   BackColor       =   &H00D8E9EC&
   BackStyle       =   0  '透明
   ClientHeight    =   2610
   ClientLeft      =   0
   ClientTop       =   0
   ClientWidth     =   4875
   ClipControls    =   0   'False
   LockControls    =   -1  'True
   ScaleHeight     =   174
   ScaleMode       =   3  'Pixel
   ScaleWidth      =   325
   ToolboxBitmap   =   "Osen XP Form.ctx":0000
   Begin VB.PictureBox PicMain 
      Appearance      =   0  'Flat
      BackColor       =   &H80000005&
      BorderStyle     =   0  'None
      ForeColor       =   &H80000008&
      Height          =   1635
      Left            =   1170
      ScaleHeight     =   1635
      ScaleWidth      =   2955
      TabIndex        =   9
      Top             =   3270
      Visible         =   0   'False
      Width           =   2955
   End
   Begin VB.PictureBox ThemeX1 
      Height          =   480
      Left            =   5400
      ScaleHeight     =   420
      ScaleWidth      =   1140
      TabIndex        =   10
      Top             =   750
      Width           =   1200
   End
   Begin VB.PictureBox CloseButton 
      Height          =   315
      Left            =   1860
      ScaleHeight     =   255
      ScaleWidth      =   255
      TabIndex        =   8
      Top             =   660
      Width           =   315
   End
   Begin VB.PictureBox MaximizeButton 
      Height          =   315
      Left            =   1500
      ScaleHeight     =   255
      ScaleWidth      =   255
      TabIndex        =   7
      Top             =   660
      Width           =   315
   End
   Begin VB.PictureBox Minimizebutton 
      Height          =   315
      Left            =   1140
      ScaleHeight     =   255
      ScaleWidth      =   255
      TabIndex        =   6
      Top             =   660
      Width           =   315
   End
   Begin VB.PictureBox pICmenu 
      Appearance      =   0  'Flat
      BackColor       =   &H00FFFFFF&
      BorderStyle     =   0  'None
      ForeColor       =   &H80000008&
      Height          =   360
      Left            =   420
      ScaleHeight     =   360
      ScaleWidth      =   3825
      TabIndex        =   3
      Top             =   -1125
      Visible         =   0   'False
      Width           =   3825
      Begin VB.PictureBox LbMenu 
         Height          =   270
         Index           =   0
         Left            =   60
         ScaleHeight     =   210
         ScaleWidth      =   600
         TabIndex        =   5
         Top             =   -375
         Visible         =   0   'False
         Width           =   660
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         BackStyle       =   0  'Transparent
         Caption         =   "Label1"
         Height          =   195
         Left            =   0
         TabIndex        =   4
         Top             =   -720
         Visible         =   0   'False
         Width           =   480
      End
      Begin VB.Line Line2 
         BorderColor     =   &H00C0C0C0&
         X1              =   -30
         X2              =   2670
         Y1              =   345
         Y2              =   345
      End
      Begin VB.Line Line1 
         BorderColor     =   &H00C0C0C0&
         X1              =   0
         X2              =   2655
         Y1              =   345
         Y2              =   345
      End
   End
   Begin VB.Image picicon 
      Height          =   240
      Left            =   1920
      Picture         =   "Osen XP Form.ctx":0312
      Top             =   -1020
      Visible         =   0   'False
      Width           =   240
   End
   Begin VB.Label LbAbout 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      Caption         =   "1"
      Height          =   195
      Left            =   2100
      TabIndex        =   2
      Top             =   -1020
      Visible         =   0   'False
      Width           =   90
   End
   Begin VB.Image TitleIcon 
      Height          =   240
      Left            =   120
      Stretch         =   -1  'True
      Top             =   120
      Width           =   240
   End
   Begin VB.Image BottomLeft 
      Height          =   60
      Left            =   0
      Picture         =   "Osen XP Form.ctx":045C
      Top             =   2520
      Width           =   60
   End
   Begin VB.Image BottomRight 
      Height          =   60
      Left            =   4800
      Picture         =   "Osen XP Form.ctx":0795
      Top             =   2520
      Width           =   60
   End
   Begin VB.Image Bottom 
      Height          =   60
      Left            =   60
      Picture         =   "Osen XP Form.ctx":0ACF
      Stretch         =   -1  'True
      Top             =   2520
      Width           =   4755
   End
   Begin VB.Image Right 
      Height          =   2085
      Left            =   4800
      MousePointer    =   9  'Size W E
      Picture         =   "Osen XP Form.ctx":0DFD
      Stretch         =   -1  'True
      Top             =   450
      Width           =   60
   End
   Begin VB.Image Left 
      Height          =   2085
      Left            =   0
      Picture         =   "Osen XP Form.ctx":112B
      Stretch         =   -1  'True
      Top             =   450
      Width           =   60
   End
   Begin VB.Label Caption1 
      AutoSize        =   -1  'True
      BackColor       =   &H00FFFFFF&
      BackStyle       =   0  'Transparent
      Caption         =   "SEN MASTER"
      BeginProperty Font 
         Name            =   "Trebuchet MS"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFFFF&
      Height          =   270
      Left            =   375
      TabIndex        =   0
      Top             =   150
      Width           =   1125
   End
   Begin VB.Label Caption2 
      AutoSize        =   -1  'True
      BackColor       =   &H00FFFFFF&
      BackStyle       =   0  'Transparent
      Caption         =   "SEN MASTER"
      BeginProperty Font 
         Name            =   "Trebuchet MS"
         Size            =   9.75
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00400000&
      Height          =   270
      Left            =   405
      TabIndex        =   1
      Top             =   150
      Width           =   1125
   End
   Begin VB.Image Title 
      Height          =   450
      Left            =   150
      Picture         =   "Osen XP Form.ctx":1459
      Stretch         =   -1  'True
      Top             =   0
      Width           =   4575
   End
   Begin VB.Image TitleRight 
      Height          =   450
      Left            =   4710
      Picture         =   "Osen XP Form.ctx":1E73
      Top             =   0
      Width           =   150
   End
   Begin VB.Image TitleLeft 
      Height          =   450
      Left            =   0
      Picture         =   "Osen XP Form.ctx":2273
      Top             =   0
      Width           =   150
   End
End
Attribute VB_Name = "OsenXPForm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
Attribute VB_Ext_KEY = "PropPageWizardRun" ,"Yes"

'/**************** Declare API Function **************************************************************************
Option Explicit

Private Type RECT
    Left As Long
    Top As Long
    Right As Long
    Bottom As Long
End Type

Private Type POINTAPI
    X As Long
    Y As Long
End Type

Public Enum XPTheme
     Blue = 0
     [Olive Green] = 1
     Silver = 2
End Enum

Private Declare Function SetCursorPos Lib "user32" (ByVal X As Long, ByVal Y As Long) As Long
Private Declare Function GetSystemMenu Lib "user32" (ByVal hwnd As Long, ByVal bRevert As Long) As Long
Private Declare Function RemoveMenu Lib "user32" (ByVal hMenu As Long, ByVal nPosition As Long, ByVal wFlags As Long) As Long
Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Private Declare Function GetClientRect Lib "user32" (ByVal hwnd As Long, lpRect As RECT) As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
Private Declare Function ReleaseCapture Lib "user32" () As Long
Private Declare Function CreateRectRgn Lib "gdi32" (ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Private Declare Function SetWindowLong Lib "user32" Alias "SetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function CombineRgn Lib "gdi32" (ByVal hDestRgn As Long, ByVal hSrcRgn1 As Long, ByVal hSrcRgn2 As Long, ByVal nCombineMode As Long) As Long
Private Declare Function SetWindowRgn Lib "user32" (ByVal hwnd As Long, ByVal hRgn As Long, ByVal bRedraw As Boolean) As Long
Private Declare Function SystemParametersInfo Lib "user32" Alias "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, ByRef lpvPara As Any, ByVal fuWinIni As Long) As Long
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function GetComputerName Lib "kernel32" Alias "GetComputerNameA" (ByVal lpBuffer As String, nSize As Long) As Long
Private Declare Function GetCursorPos Lib "user32" (lpPoint As POINTAPI) As Long
Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long

Private Const WM_NCLBUTTONDOWN         As Long = &HA1
Private Const HTCAPTION                As Long = 2
Private bTransparent                   As Boolean
Private Const MF_BYPOSITION            As Long = &H400&
Private Const MF_BYCOMMAND             As Long = 0
Private Const SC_RESTORE               As Long = &HF120
Private Const SC_MOVE                  As Long = &HF010
Private Const SC_SIZE                  As Long = &HF000
Private Const SC_MINIMIZE              As Long = &HF020
Private Const SC_MAXIMIZE              As Long = &HF030
Private Const SC_CLOSE                 As Long = &HF060
Private Const WM_GETSYSMENU            As Long = &H313
Private Const HWND_TOPMOST             As Long = -1
Private Const HWND_NOTOPMOST           As Long = -2
Private Const SWP_SHOWWINDOW           As Long = &H40

Private MenuCOUNT As Integer

Private Oldcp As POINTAPI ':(燤issing Scope
Private Newcp As POINTAPI ':(燤issing Scope

Private WithEvents MyForm As Form
Attribute MyForm.VB_VarHelpID = -1

Private Const GWL_STYLE     As Long = (-16)
Private Const WS_SYSMENU    As Long = &H80000
Private m_AutoLoad          As Boolean
Private m_ShowMinimize      As Boolean
Private m_ShowMaximize      As Boolean
Private m_ShowClose         As Boolean
Private m_ShowHelp          As Boolean
Private m_EnableMaximize    As Boolean

Public Event Resize(IsTop As Integer, IsHeight As Integer, IsWidth As Integer) 'MappingInfo=UserControl,UserControl,-1,Resize
Public Event Help()
Public Event CloseForm()

Private Const m_def_AutoLoad        As Boolean = False
Private Const m_def_ShowMinimize    As Boolean = True
Private Const m_def_ShowMaximize    As Boolean = True
Private Const m_def_ShowClose       As Boolean = True
Private Const m_def_ShowHelp        As Boolean = False
Private Const m_def_EnableMaximize  As Boolean = True

Private MyTitleIcon     As Image
Private IsHoverMenu     As Integer
Private IsPressMenu     As Integer
Private MyMainMenu()    As Object
Private IsLoad          As Boolean

Private Const m_def_IpModal As Long = -1
Private m_IpModal As Integer

'Default Property Values:
Const m_def_Theme = 0
Private Const m_def_TitleTop    As Integer = -2
Private Const m_def_IconTop     As Integer = 7
Private Const m_def_IconIndex   As Integer = 0
Private Const m_def_CloseActive As Integer = False

'Property Variables:
Private m_Theme As XPTheme
Private m_TitleTop As Integer
Private m_IconTop As Integer
Private m_IconIndex As Integer
Private m_CloseActive As Boolean
Private m_HaveChild As Boolean

'Event Declarations:
Public Event Click()
Public Event DblClick()
Public Event MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) 'MappingInfo=PicMain,PicMain,-1,MouseMove
Public Event MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) 'MappingInfo=PicMain,PicMain,-1,MouseDown
Private m_activeform As Integer

Public Sub About()
Attribute About.VB_UserMemId = -552

    M_About_Theme = m_Theme
    Frm_About.Show 1

End Sub

Public Property Get AutoLoad() As Boolean

    AutoLoad = m_AutoLoad

End Property

Public Property Let AutoLoad(ByVal New_AutoLoad As Boolean)

    m_AutoLoad = New_AutoLoad
    PropertyChanged "AutoLoad"

End Property

Public Property Let BackColor(ByVal New_BackColor As OLE_COLOR)
Attribute BackColor.VB_Description = "Returns/sets the background color used to display text and graphics in an object."

    PicMain.BackColor() = New_BackColor
    PropertyChanged "BackColor"

End Property

Public Property Get BackColor() As OLE_COLOR

    BackColor = PicMain.BackColor

End Property

Private Sub Bottom_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)

    If MyForm Is Nothing Then Exit Sub ':(燛xpand Structure or consider reversing Condition
    If (MyForm.BorderStyle = 2) Then
        GetCursorPos Oldcp
    End If

End Sub

Private Sub Bottom_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

    On Error GoTo Z
    If MyForm Is Nothing Then Exit Sub ':(燛xpand Structure or consider reversing Condition
    If (MyForm.BorderStyle = 2) And (MyForm.WindowState = 0) Then
        Bottom.MousePointer = 7
      Else 'NOT (MYFORM.BORDERSTYLE...
        Bottom.MousePointer = 0
    End If

    If MyForm.WindowState = 2 Then
        TaskBarShow
    End If
Z:

End Sub

⌨️ 快捷键说明

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