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

📄 form1.frm

📁 Tsplitter是一个类
💻 FRM
字号:
VERSION 5.00
Object = "{0D452EE1-E08F-101A-852E-02608C4D0BB4}#2.0#0"; "FM20.DLL"
Begin VB.Form Form1 
   Caption         =   "Form Splitter"
   ClientHeight    =   3195
   ClientLeft      =   165
   ClientTop       =   735
   ClientWidth     =   6345
   ClipControls    =   0   'False
   LinkTopic       =   "Form1"
   ScaleHeight     =   3195
   ScaleWidth      =   6345
   StartUpPosition =   3  'Windows Default
   Begin MSForms.Frame Frame2 
      Height          =   2775
      Left            =   3120
      OleObjectBlob   =   "Form1.frx":0000
      TabIndex        =   1
      Top             =   240
      Width           =   3015
   End
   Begin MSForms.Frame Frame1 
      Height          =   2775
      Left            =   240
      OleObjectBlob   =   "Form1.frx":0A18
      TabIndex        =   0
      Top             =   240
      Width           =   2535
   End
   Begin VB.Menu mnuHelp 
      Caption         =   "?"
      Begin VB.Menu mnuAbout 
         Caption         =   "&About"
      End
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'////////////////////////////////////////////////////
'
' Example to use the TSplitter class
'
' The Form contains two Frames (Frame1 and Frame2) that resizes
' with a splitter
'
' The example and the TSplitter class use a simple class, TRect, to manage the dimensions
' and the geometry of Frames

Private splitter As TSplitter
Private Sub Form_Load()
  Dim rc As TRect
    Set splitter = New TSplitter
    Set rc = New TRect
    rc.GetFormRect Me
    ' says to splitter the dimensions of the rectangle to manage
    ' in this case the entire form, the proportions of the two frames
    'and the type of splitter (Vertical or Orizontal)
    splitter.Init Me, rc, 0.5, spVertical
End Sub

Private Sub Form_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
    splitter.MouseDown
End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    splitter.MouseMove X, Y
End Sub

Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
   With splitter
    If .MouseUp(X, Y) Then  'the splitter has been dragged
       .ResizeFrame 1, Frame1
       .ResizeFrame 2, Frame2
       Refresh
    End If
  End With
End Sub

Private Sub Form_Paint()
    splitter.DEdge
End Sub

Private Sub Form_Resize()
  Dim rc As TRect
  If ScaleWidth = 0 Then Exit Sub 'ridotto a icona
   With splitter
    Set rc = New TRect
    rc.GetFormRect Me
    .Resize rc 'says to splitter the new dimension of Form1
    .ResizeFrame 1, Frame1 'resizes the frames
    .ResizeFrame 2, Frame2
   End With
End Sub

Private Sub mnuAbout_Click()
  frmAbout.Show 1
End Sub

⌨️ 快捷键说明

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