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

📄 options.frm

📁 VB版的小游戏
💻 FRM
字号:
VERSION 5.00
Begin VB.Form Form3 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Octopus Options"
   ClientHeight    =   3180
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   6570
   Icon            =   "Options.frx":0000
   LinkTopic       =   "Form3"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3180
   ScaleMode       =   0  'User
   ScaleWidth      =   6548.941
   StartUpPosition =   2  'CenterScreen
   Begin VB.Frame Frame3 
      Caption         =   "&Other"
      Height          =   1050
      Left            =   1260
      TabIndex        =   7
      Top             =   1605
      Width           =   5220
      Begin VB.CheckBox Check2 
         Caption         =   "Always on &top"
         Height          =   315
         Left            =   135
         TabIndex        =   9
         Top             =   630
         Width           =   1365
      End
      Begin VB.CheckBox Check1 
         Caption         =   "&Automatically show main window when alarm time is reached"
         Height          =   315
         Left            =   135
         TabIndex        =   8
         Top             =   300
         Width           =   4695
      End
   End
   Begin VB.CommandButton Command4 
      Caption         =   "&Default"
      Height          =   345
      Left            =   5490
      TabIndex        =   13
      Top             =   2745
      Width           =   975
   End
   Begin VB.CommandButton Command3 
      Caption         =   "&Apply"
      Enabled         =   0   'False
      Height          =   345
      Left            =   4395
      TabIndex        =   12
      Top             =   2745
      Width           =   975
   End
   Begin VB.CommandButton Command2 
      Cancel          =   -1  'True
      Caption         =   "&Cancel"
      Height          =   345
      Left            =   3300
      TabIndex        =   11
      Top             =   2745
      Width           =   975
   End
   Begin VB.CommandButton Command1 
      Caption         =   "&OK"
      Default         =   -1  'True
      Height          =   345
      Left            =   2220
      TabIndex        =   10
      Top             =   2745
      Width           =   975
   End
   Begin VB.Frame Frame1 
      Caption         =   "S&peed"
      Height          =   1500
      Left            =   75
      TabIndex        =   0
      Top             =   45
      Width           =   6405
      Begin VB.HScrollBar HScroll3 
         Height          =   255
         Left            =   1305
         Max             =   440
         TabIndex        =   3
         Top             =   1095
         Value           =   141
         Width           =   4920
      End
      Begin VB.HScrollBar HScroll2 
         Height          =   255
         Left            =   1305
         Max             =   440
         TabIndex        =   2
         Top             =   765
         Value           =   271
         Width           =   4920
      End
      Begin VB.HScrollBar HScroll1 
         Height          =   255
         Left            =   1305
         Max             =   440
         TabIndex        =   1
         Top             =   435
         Value           =   221
         Width           =   4920
      End
      Begin VB.Label DiverSpeed 
         AutoSize        =   -1  'True
         Caption         =   "Diver"
         Height          =   210
         Left            =   135
         TabIndex        =   18
         Top             =   1110
         Width           =   375
      End
      Begin VB.Label GameBSpeed 
         AutoSize        =   -1  'True
         Caption         =   "Game B"
         Height          =   210
         Left            =   120
         TabIndex        =   17
         Top             =   780
         Width           =   570
      End
      Begin VB.Label Label2 
         AutoSize        =   -1  'True
         Caption         =   "Fast"
         Height          =   210
         Left            =   5910
         TabIndex        =   16
         Top             =   150
         Width           =   300
      End
      Begin VB.Label Label1 
         AutoSize        =   -1  'True
         Caption         =   "Slow"
         Height          =   210
         Left            =   1305
         TabIndex        =   15
         Top             =   165
         Width           =   345
      End
      Begin VB.Label GameASpeed 
         AutoSize        =   -1  'True
         Caption         =   "Game A"
         Height          =   210
         Left            =   120
         TabIndex        =   14
         Top             =   450
         Width           =   570
      End
   End
   Begin VB.Frame Frame2 
      Caption         =   "&Sound"
      Height          =   1050
      Left            =   75
      TabIndex        =   4
      Top             =   1605
      Width           =   1035
      Begin VB.OptionButton SoundOn 
         Caption         =   "On"
         Height          =   210
         Left            =   105
         TabIndex        =   5
         Top             =   360
         Width           =   555
      End
      Begin VB.OptionButton SoundOff 
         Caption         =   "Off"
         Height          =   210
         Left            =   120
         TabIndex        =   6
         Top             =   675
         Width           =   555
      End
   End
End
Attribute VB_Name = "Form3"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'Module:   Options.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

Private Sub Form_Load()
    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
    
    'speed
    HScroll1.Value = HScroll1.Max - GetSetting("Game & Watch Simulator", "Octopus", "Game A Speed") + 1
    HScroll2.Value = HScroll2.Max - GetSetting("Game & Watch Simulator", "Octopus", "Game B Speed") + 1
    HScroll3.Value = HScroll3.Max - GetSetting("Game & Watch Simulator", "Octopus", "Diver Speed") + 1
    Command3.Enabled = False
    GameASpeed.Caption = "Game A (" + Format(HScroll1.Value + 1) + ")"
    GameBSpeed.Caption = "Game B (" + Format(HScroll2.Value + 1) + ")"
    DiverSpeed.Caption = "Diver (" + Format(HScroll3.Value + 1) + ")"
    
    'sound
    If Form1.mSound.Checked Then
        SoundOn.Value = True
    Else
        SoundOff.Value = True
    End If
    
    'other
    If GetSetting("Game & Watch Simulator", "Octopus", "Auto Show") Then
        Check1.Value = 1
    End If
    
    If GetSetting("Game & Watch Simulator", "Octopus", "Always on Top") Then
        Check2.Value = 1
    End If
    
    SendKeys "{TAB}"
    Command3.Enabled = False
End Sub

Private Sub Form_Unload(Cancel As Integer)
    Form3.Hide
End Sub

Private Sub Check1_Click()
    Command3.Enabled = True
End Sub

Private Sub Check2_Click()
    Command3.Enabled = True
End Sub

Private Sub Command1_Click()
    Command3_Click
    Unload Form3
End Sub

Private Sub Command2_Click()
    Unload Form3
End Sub

Private Sub Command3_Click()
    Command3.Enabled = False
    
    'speed
    SaveSetting "Game & Watch Simulator", "Octopus", "Game A Speed", HScroll1.Max - HScroll1.Value + 1
    SaveSetting "Game & Watch Simulator", "Octopus", "Game B Speed", HScroll2.Max - HScroll2.Value + 1
    SaveSetting "Game & Watch Simulator", "Octopus", "Diver Speed", HScroll3.Max - HScroll3.Value + 1
    Form1.DoCheckSpeed
    
    'sound
    If SoundOn.Value Then
        SaveSetting "Game & Watch Simulator", "Octopus", "Sound", True
        Form1.mSound.Checked = True
    Else
        SaveSetting "Game & Watch Simulator", "Octopus", "Sound", False
        Form1.mSound.Checked = False
    End If
    
    'other
    If Check1.Value = 1 Then
        Form1.mAutoShow.Checked = True
    Else
        Form1.mAutoShow.Checked = False
    End If
    
    If Check2.Value = 1 Then
        Form1.mAlwaysOnTop.Checked = True
    Else
        Form1.mAlwaysOnTop.Checked = False
    End If
End Sub

Private Sub Command4_Click()
    HScroll1.Value = 221
    HScroll2.Value = 271
    HScroll3.Value = 141
    SoundOn.Value = True
    SoundOff.Value = False
    Check1.Value = 1
    Check2.Value = 1
    Command3.Enabled = True
End Sub

Private Sub HScroll1_Change()
    GameASpeed.Caption = "Game A (" + Format(HScroll1.Value + 1) + ")"
    Command3.Enabled = True
End Sub

Private Sub HScroll1_Scroll()
    GameASpeed.Caption = "Game A (" + Format(HScroll1.Value + 1) + ")"
End Sub

Private Sub HScroll2_Change()
    GameBSpeed.Caption = "Game B (" + Format(HScroll2.Value + 1) + ")"
    Command3.Enabled = True
End Sub

Private Sub HScroll2_Scroll()
    GameBSpeed.Caption = "Game B (" + Format(HScroll2.Value + 1) + ")"
End Sub

Private Sub HScroll3_Change()
    DiverSpeed.Caption = "Diver (" + Format(HScroll3.Value + 1) + ")"
    Command3.Enabled = True
End Sub

Private Sub HScroll3_Scroll()
    DiverSpeed.Caption = "Diver (" + Format(HScroll3.Value + 1) + ")"
End Sub

Private Sub SoundOff_Click()
    Command3.Enabled = True
    SoundOn.Value = False
    SoundOff.Value = True
End Sub

Private Sub SoundOn_Click()
    Command3.Enabled = True
    SoundOn.Value = True
    SoundOff.Value = False
End Sub

⌨️ 快捷键说明

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