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

📄 frmexample.frm

📁 几个不错的VB例子
💻 FRM
📖 第 1 页 / 共 3 页
字号:
            Height          =   285
            Left            =   1800
            TabIndex        =   22
            Text            =   "Text6"
            Top             =   2280
            Width           =   1455
         End
         Begin VB.TextBox Text14 
            Height          =   285
            Left            =   120
            TabIndex        =   21
            Text            =   "Text5"
            Top             =   2280
            Width           =   1575
         End
         Begin VB.TextBox Text13 
            Height          =   285
            Left            =   1800
            TabIndex        =   20
            Text            =   "Text4"
            Top             =   1920
            Width           =   1455
         End
         Begin VB.TextBox Text12 
            Height          =   285
            Left            =   1800
            TabIndex        =   18
            Text            =   "Text2"
            Top             =   1560
            Width           =   1455
         End
         Begin VB.TextBox Text11 
            Height          =   285
            Left            =   120
            TabIndex        =   17
            Text            =   "Text1"
            Top             =   1560
            Width           =   1575
         End
         Begin VB.CommandButton Command121 
            Caption         =   "Command1"
            Height          =   375
            Left            =   120
            Style           =   1  'Graphical
            TabIndex        =   13
            Top             =   600
            Width           =   1575
         End
         Begin VB.CommandButton Command11 
            Caption         =   "Command2"
            Height          =   375
            Left            =   1800
            Style           =   1  'Graphical
            TabIndex        =   14
            Top             =   600
            Width           =   1575
         End
         Begin VB.CommandButton Command49 
            Caption         =   "Command4"
            Height          =   375
            Left            =   1800
            Style           =   1  'Graphical
            TabIndex        =   16
            Top             =   1080
            Width           =   1575
         End
         Begin VB.PictureBox Picture6 
            Appearance      =   0  'Flat
            AutoSize        =   -1  'True
            BackColor       =   &H80000005&
            BorderStyle     =   0  'None
            ForeColor       =   &H80000008&
            Height          =   225
            Left            =   240
            Picture         =   "frmExample.frx":2289
            ScaleHeight     =   225
            ScaleWidth      =   240
            TabIndex        =   50
            TabStop         =   0   'False
            Top             =   3600
            Width           =   240
         End
         Begin VB.Label Label7 
            BackStyle       =   0  'Transparent
            Caption         =   "Aditional Information:"
            BeginProperty Font 
               Name            =   "MS Sans Serif"
               Size            =   8.25
               Charset         =   0
               Weight          =   700
               Underline       =   0   'False
               Italic          =   0   'False
               Strikethrough   =   0   'False
            EndProperty
            Height          =   255
            Left            =   120
            TabIndex        =   62
            Top             =   240
            Width           =   2535
         End
         Begin VB.Label Label3 
            Caption         =   "Label2"
            Height          =   255
            Left            =   600
            TabIndex        =   52
            Top             =   3600
            Width           =   615
         End
      End
   End
   Begin VB.CommandButton Command6 
      Caption         =   "Go To >>"
      BeginProperty Font 
         Name            =   "Arial"
         Size            =   8.25
         Charset         =   0
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   300
      Left            =   1920
      Style           =   1  'Graphical
      TabIndex        =   55
      Top             =   2880
      Width           =   855
   End
   Begin VB.CommandButton Command9 
      Height          =   255
      Left            =   2520
      Picture         =   "frmExample.frx":2638
      Style           =   1  'Graphical
      TabIndex        =   54
      ToolTipText     =   "Delete Page"
      Top             =   2640
      Width           =   615
   End
   Begin VB.CommandButton Command8 
      Height          =   255
      Left            =   1920
      Picture         =   "frmExample.frx":26BA
      Style           =   1  'Graphical
      TabIndex        =   53
      ToolTipText     =   "Add Page"
      Top             =   2640
      Width           =   615
   End
   Begin VB.TextBox Text9 
      Height          =   300
      Left            =   2760
      TabIndex        =   56
      Text            =   "1"
      Top             =   2880
      Width           =   375
   End
   Begin VB.CommandButton Command12 
      BackColor       =   &H00C0E0FF&
      Caption         =   "Vote for this code >>"
      Height          =   375
      Left            =   3360
      Style           =   1  'Graphical
      TabIndex        =   68
      Top             =   2640
      Width           =   1695
   End
   Begin VB.Timer Timer1 
      Enabled         =   0   'False
      Interval        =   6000
      Left            =   4680
      Top             =   3000
   End
   Begin VB.Label Label9 
      Caption         =   $"frmExample.frx":2796
      ForeColor       =   &H00C00000&
      Height          =   975
      Left            =   120
      TabIndex        =   69
      Top             =   3480
      Width           =   4575
   End
End
Attribute VB_Name = "frmExample"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False

'Add first four pages...
Private Sub Form_Load()
    ScrllngFrm1.AddPage Picture1
    ScrllngFrm1.AddPage Picture2
    ScrllngFrm1.AddPage Picture3
    ScrllngFrm1.AddPage Picture4
    
End Sub

'================================
'==== Navigate through pages ====
'================================

'Go to Previous Page...
Private Sub Command1_Click()
    ScrllngFrm1.PreviousPage
    
End Sub

'Go to First Page...
Private Sub Command2_Click()
    ScrllngFrm1.FirstPage
    
End Sub

'Go to Last Page...
Private Sub Command5_Click()
    ScrllngFrm1.LastPage
    
End Sub

'Go to Next Page...
Private Sub Command3_Click()
    ScrllngFrm1.NextPage
    
End Sub

'Go to page number displayed on TextBox...
Private Sub Command6_Click()
    ScrllngFrm1.CurrentPage = Text9.Text
    
End Sub

'====================
'==== Edit pages ====
'====================

'Add page 5...
Private Sub Command8_Click()
    ScrllngFrm1.AddPage Picture5
    
End Sub

'Delete current page...
Private Sub Command9_Click()
    Call ScrllngFrm1.DeletePage(ScrllngFrm1.CurrentPage)
    
End Sub

'=====================================
'==== Open Default Browser on     ====
'==== Planet-Source-Code to vote. ====
'=====================================

Private Sub Command12_Click()
    'The API that allows me to open the browser
    'in shell mode is on the modShell Module.
    Call Shell("cmd /c start http://www.planet-source-code.com/vb/default.asp?lngCId=32374&lngWId=1")
    Timer1.Enabled = True
    
End Sub

Private Sub Timer1_Timer()
    Timer1.Enabled = False
    
    'I had to call this API a second time
    'because, some times, PSC opens a default
    'page instead of the page with my submission...
    Call Shell("cmd /c start http://www.planet-source-code.com/vb/default.asp?lngCId=32374&lngWId=1")
    
End Sub

'Put all the objects on proper
'place when resizing.
Private Sub Form_Resize()
    Dim intTempTop
    Dim intTempSpace
    
    On Error Resume Next
    
    'Prevent user from resizing the
    'Form into a size too small.
    If (Me.Height < 1500) Then
        Me.Height = 1500
    End If
    
    intTempTop = 600
    intTempSpace = ScrllngFrm1.Top + ScrllngFrm1.Height + intTempTop
    
    ScrllngFrm1.Width = Me.Width - 300
    ScrllngFrm1.Height = Me.Height - (2000 + intTempTop)
    
    Frame4.Top = ScrllngFrm1.Top + ScrllngFrm1.Height
    
    Command9.Top = ScrllngFrm1.Top + ScrllngFrm1.Height + 220
    Command8.Top = ScrllngFrm1.Top + ScrllngFrm1.Height + 220
    
    Command6.Top = Command8.Top + Command8.Height
    Text9.Top = Command8.Top + Command8.Height
    
    Command12.Top = ScrllngFrm1.Top + ScrllngFrm1.Height + 230
    
    Label9.Top = ScrllngFrm1.Top + ScrllngFrm1.Height + 900
End Sub

'On PageChanged event, update current
'page number, total of pages and if
'Navigation buttons should be enabled
'and/or visible.
Private Sub ScrllngFrm1_PageChanged()
    Label1.Caption = ScrllngFrm1.CurrentPage & " of " & ScrllngFrm1.HowManyPages
    Text9.Text = ScrllngFrm1.CurrentPage
    
    Command1.Enabled = ScrllngFrm1.PreviousEnabled
    Command2.Enabled = ScrllngFrm1.PreviousEnabled
    Command5.Enabled = ScrllngFrm1.NextEnabled
    Command3.Enabled = ScrllngFrm1.NextEnabled
    
    If (ScrllngFrm1.HowManyPages < 2) Then
        Command1.Visible = False
        Command2.Visible = False
        Command5.Visible = False
        Command3.Visible = False
    Else
        Command1.Visible = True
        Command2.Visible = True
        Command5.Visible = True
        Command3.Visible = True
    End If
    
End Sub

⌨️ 快捷键说明

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