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

📄 frmcurrenpage.frm

📁 金算盘软件代码
💻 FRM
字号:
VERSION 5.00
Object = "{D252F124-F62C-11D1-9ABD-444553540000}#1.0#0"; "GADATE.DLL"
Begin VB.Form FrmCurrenPage 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "指定当前页"
   ClientHeight    =   1320
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   4680
   HelpContextID   =   10003
   Icon            =   "FrmCurrenPage.frx":0000
   LinkTopic       =   "Form1"
   LockControls    =   -1  'True
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   1320
   ScaleWidth      =   4680
   StartUpPosition =   2  '屏幕中心
   Begin VB.CommandButton CmdCancel 
      Height          =   350
      Left            =   3240
      Style           =   1  'Graphical
      TabIndex        =   3
      Top             =   540
      UseMaskColor    =   -1  'True
      Width           =   1215
   End
   Begin VB.CommandButton CmdOK 
      Height          =   350
      Left            =   3240
      Style           =   1  'Graphical
      TabIndex        =   2
      Top             =   120
      UseMaskColor    =   -1  'True
      Width           =   1215
   End
   Begin VB.Frame Frame1 
      Height          =   1035
      Left            =   240
      TabIndex        =   0
      Top             =   45
      Width           =   2655
      Begin GACALENDARLibCtl.SpinEdit SpiCurrenPage 
         Height          =   315
         Left            =   1860
         OleObjectBlob   =   "FrmCurrenPage.frx":000C
         TabIndex        =   4
         Top             =   420
         Width           =   675
      End
      Begin VB.Label LblTitle 
         Caption         =   "指定当前页(1~3)"
         Height          =   195
         Left            =   180
         TabIndex        =   1
         Top             =   480
         Width           =   1635
      End
   End
End
Attribute VB_Name = "FrmCurrenPage"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private mlngCurPage As Long
Private mintMax As Long
Private mstrOld As String

Public Function ShowFrmCurrenPage(ByVal intCurrenPage As Long, ByVal intMax As Long) As Integer
    If intCurrenPage < 1 Then
        mlngCurPage = 1
    Else
        mlngCurPage = intCurrenPage
    End If
    If mlngCurPage > intMax Then
        mintMax = mlngCurPage
    Else
        mintMax = intMax
    End If
    Me.Show vbModal
    ShowFrmCurrenPage = mlngCurPage
End Function
Private Sub CmdCancel_Click()
    Unload Me
End Sub

Private Sub cmdOK_Click()
    If mlngCurPage <> Val(SpiCurrenPage.Text) Then
        mlngCurPage = Val(SpiCurrenPage.Text)
    End If
    Unload Me
End Sub

Private Sub Form_Activate()
    SetHelpID Me.HelpContextID
End Sub

Private Sub Form_Load()
    Me.HelpContextID = 10003
    Me.Icon = Utility.GetFormResPicture(139, vbResIcon)
    CmdOK.Picture = GetFormResPicture(1001, vbResBitmap)
    CmdCancel.Picture = GetFormResPicture(1002, vbResBitmap)
    
    LblTitle.Caption = "指定当前页(1~" & CStr(mintMax) & ")"
    SpiCurrenPage.Min = 1
    SpiCurrenPage.Max = mintMax
    SpiCurrenPage.Text = mlngCurPage
End Sub

Private Sub Form_Unload(Cancel As Integer)
    Utility.RemoveFormResPicture 139
    Utility.RemoveFormResPicture 1001
    Utility.RemoveFormResPicture 1002
End Sub

Private Sub SpiCurrenPage_Change()
    If Not IsNumeric(SpiCurrenPage.Text) Then
        Utility.ShowMsg Me.hwnd, "请输入数值!", vbOKOnly + vbExclamation, "格式设置"
        SpiCurrenPage.Text = mstrOld
    ElseIf Val(SpiCurrenPage.Text) < SpiCurrenPage.Min Or Val(SpiCurrenPage.Text) > SpiCurrenPage.Max Then
        Utility.ShowMsg Me.hwnd, "数值无效!", vbOKOnly + vbExclamation, "格式设置"
        SpiCurrenPage.Text = mstrOld
    Else
    End If
End Sub

Private Sub SpiCurrenPage_GotFocus()
    mstrOld = SpiCurrenPage.Text
End Sub
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'                        私有过程

⌨️ 快捷键说明

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