📄 instruct.frm
字号:
VERSION 5.00
Begin VB.Form Form4
BackColor = &H00FFFFFF&
BorderStyle = 0 'None
ClientHeight = 3750
ClientLeft = 0
ClientTop = 0
ClientWidth = 6195
Icon = "Instruct.frx":0000
LinkTopic = "Form5"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3750
ScaleWidth = 6195
ShowInTaskbar = 0 'False
StartUpPosition = 2 'CenterScreen
Begin VB.Image PageNo
Enabled = 0 'False
Height = 3750
Index = 8
Left = 570
Picture = "Instruct.frx":08CA
Top = 4050
Visible = 0 'False
Width = 6195
End
Begin VB.Label Label1
Alignment = 1 'Right Justify
AutoSize = -1 'True
BackColor = &H00FFFFFF&
BeginProperty Font
Name = "MS Sans Serif"
Size = 7.5
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 210
Left = 6045
TabIndex = 0
Top = 60
Visible = 0 'False
Width = 60
End
Begin VB.Image Picture1
Height = 3750
Left = 0
Top = 0
Width = 6195
End
Begin VB.Image PageNo
Enabled = 0 'False
Height = 3750
Index = 1
Left = 960
Picture = "Instruct.frx":1A0A6
Top = 3780
Visible = 0 'False
Width = 6195
End
Begin VB.Image PageNo
Enabled = 0 'False
Height = 3750
Index = 2
Left = 15
Picture = "Instruct.frx":33B2A
Top = 4050
Visible = 0 'False
Width = 6195
End
Begin VB.Image PageNo
Enabled = 0 'False
Height = 3750
Index = 3
Left = 510
Picture = "Instruct.frx":4D5AE
Top = 4230
Visible = 0 'False
Width = 6195
End
Begin VB.Image PageNo
Enabled = 0 'False
Height = 3750
Index = 4
Left = 825
Picture = "Instruct.frx":67032
Top = 4365
Visible = 0 'False
Width = 6195
End
Begin VB.Image PageNo
Enabled = 0 'False
Height = 3750
Index = 5
Left = 360
Picture = "Instruct.frx":80AB6
Top = 3870
Visible = 0 'False
Width = 6195
End
Begin VB.Image PageNo
Enabled = 0 'False
Height = 3750
Index = 6
Left = 1215
Picture = "Instruct.frx":9A53A
Top = 4500
Visible = 0 'False
Width = 6195
End
Begin VB.Image PageNo
Enabled = 0 'False
Height = 3750
Index = 7
Left = 1200
Picture = "Instruct.frx":B3FBE
Top = 4455
Visible = 0 'False
Width = 6195
End
Begin VB.Image PageNo
Enabled = 0 'False
Height = 3750
Index = 0
Left = 90
Picture = "Instruct.frx":CDA42
Top = 4095
Visible = 0 'False
Width = 6195
End
End
Attribute VB_Name = "Form4"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'Module: Instruct.frm
'Author: Pheeraphat Sawangphian
'E-Mail: tooh@thaimail.com
'URL: http://www.geocities.com/Hollywood/Lot/6166/
Option Explicit
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
'Constants for SetWindowPos
Private Const HWND_TOPMOST = -1
Private Const HWND_NOTOPMOST = -2
Private Const SWP_NOSIZE = &H1
Private Const SWP_NOMOVE = &H2
Dim StartMove As Boolean
Dim DifferenceX As Single
Dim DifferenceY As Single
Dim OldX As Single
Dim OldY As Single
Dim PageNumber As Integer
Dim LastPageNumber As Integer
Private Sub Form_Load()
PageNumber = 1
LastPageNumber = 9
Picture1.Picture = PageNo(PageNumber - 1).Picture
StartMove = False
SendKeys "{TAB}"
If Form1.mAlwaysOnTop.Checked Then
SetWindowPos hWnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE Or SWP_NOMOVE
Else
SetWindowPos hWnd, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE Or SWP_NOMOVE
End If
End Sub
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyReturn Or KeyCode = vbKeyPageDown Or KeyCode = vbKeyRight Or KeyCode = vbKeyDown Then
DoNextPage
ElseIf KeyCode = vbKeyPageUp Or KeyCode = vbKeyBack Or KeyCode = vbKeyLeft Or KeyCode = vbKeyUp Then
DoPreviousPage
ElseIf PageNumber > 1 And KeyCode = vbKeyHome Then
PageNumber = 0
DoNextPage
ElseIf PageNumber < LastPageNumber And KeyCode = vbKeyEnd Then
PageNumber = LastPageNumber - 1
DoNextPage
ElseIf KeyCode = vbKeyEscape Then
Unload Form4
End If
End Sub
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
DoMouseDown Button, X, Y
End Sub
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
DoMouseMove Button, X, Y
End Sub
Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
DoMouseUp Button
End Sub
Public Sub DoNextPage()
PageNumber = PageNumber + 1
If PageNumber > LastPageNumber Then
PageNumber = 1
End If
Picture1.Picture = PageNo(PageNumber - 1).Picture
Label1.Caption = Format(PageNumber)
If PageNumber = 1 Then
Label1.Visible = False
Else
Label1.Visible = True
End If
End Sub
Public Sub DoPreviousPage()
PageNumber = PageNumber - 1
If PageNumber < 1 Then
PageNumber = LastPageNumber
End If
Picture1.Picture = PageNo(PageNumber - 1).Picture
Label1.Caption = Format(PageNumber)
If PageNumber = 1 Then
Label1.Visible = False
Else
Label1.Visible = True
End If
End Sub
Private Sub DoMouseDown(Button As Integer, X As Single, Y As Single)
If Button = 1 Then
If Not StartMove Then
DifferenceX = X
DifferenceY = Y
OldX = Left
OldY = Top
StartMove = True
End If
End If
End Sub
Private Sub DoMouseMove(Button As Integer, X As Single, Y As Single)
If Button = 1 Then
If StartMove Then
Move Left + (X - DifferenceX), Top + (Y - DifferenceY)
DoEvents 'make sure it cleans up
End If
End If
End Sub
Private Sub DoMouseUp(Button As Integer)
If Button = 1 Then
If StartMove Then
StartMove = False
If Left = OldX And Top = OldY Then
DoNextPage
End If
End If
ElseIf Button = 2 Then
DoPreviousPage
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -