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

📄 form1.frm

📁 vb 窗体实例 都是自己的例子
💻 FRM
字号:
VERSION 5.00
Begin VB.Form form1 
   AutoRedraw      =   -1  'True
   Caption         =   "动态改变控件的尺寸"
   ClientHeight    =   2865
   ClientLeft      =   60
   ClientTop       =   240
   ClientWidth     =   3405
   Icon            =   "Form1.frx":0000
   LinkTopic       =   "Form1"
   ScaleHeight     =   2865
   ScaleWidth      =   3405
   StartUpPosition =   1  '所有者中心
   Begin VB.CommandButton Command2 
      Caption         =   "退出"
      Height          =   375
      Left            =   1290
      TabIndex        =   1
      Top             =   2280
      Width           =   1365
   End
   Begin VB.PictureBox Picture1 
      Appearance      =   0  'Flat
      AutoRedraw      =   -1  'True
      BackColor       =   &H80000005&
      ForeColor       =   &H80000008&
      Height          =   1605
      Left            =   405
      Picture         =   "Form1.frx":000C
      ScaleHeight     =   1575
      ScaleWidth      =   2175
      TabIndex        =   0
      Top             =   345
      Width           =   2205
   End
End
Attribute VB_Name = "form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As Long, _
    ByVal nIndex 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 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

Const SWP_NOSIZE = &H1
Const SWP_NOZORDER = &H4
Const SWP_NOMOVE = &H2
Const SWP_DRAWFRAME = &H20
Const GWL_STYLE = (-16)

Const WS_THICKFRAME = &H40000

Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
  Dim mousemove As Boolean
  mousemove = (X > 0) And (X < Picture1.Width) And (Y > 0) And (Y < Picture1.Height)
  If mousemove Then
     Dim NewStyle As Long
     NewStyle = GetWindowLong(Picture1.hwnd, GWL_STYLE)
     NewStyle = NewStyle Or WS_THICKFRAME
     NewStyle = SetWindowLong(Picture1.hwnd, GWL_STYLE, NewStyle)     '调整控件大小
    Else
    
  End If
End Sub
Private Sub Command2_Click()
  End
End Sub





⌨️ 快捷键说明

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