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

📄 fload.frm

📁 一个用VB编的小游戏
💻 FRM
字号:
VERSION 5.00
Begin VB.Form fLoad 
   BorderStyle     =   1  'Fixed Single
   Caption         =   "Form1"
   ClientHeight    =   3195
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   4920
   ControlBox      =   0   'False
   Icon            =   "fLoad.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   3195
   ScaleWidth      =   4920
   StartUpPosition =   3  'Windows Default
   Begin VB.TextBox txtFile 
      Height          =   270
      Left            =   120
      TabIndex        =   6
      Top             =   240
      Visible         =   0   'False
      Width           =   1815
   End
   Begin VB.CommandButton cmd 
      Caption         =   "取消"
      Height          =   375
      Index           =   1
      Left            =   3960
      TabIndex        =   4
      Top             =   1200
      Width           =   855
   End
   Begin VB.CommandButton cmd 
      Caption         =   "确定"
      Height          =   375
      Index           =   0
      Left            =   3960
      TabIndex        =   3
      Top             =   600
      Width           =   855
   End
   Begin VB.FileListBox FFile 
      Height          =   2430
      Left            =   120
      Pattern         =   "*.wyf"
      TabIndex        =   2
      Top             =   600
      Width           =   1815
   End
   Begin VB.DirListBox FDir 
      Height          =   2400
      Left            =   2040
      TabIndex        =   1
      Top             =   240
      Width           =   1815
   End
   Begin VB.DriveListBox FDrive 
      Height          =   300
      Left            =   2040
      TabIndex        =   0
      Top             =   2760
      Width           =   1815
   End
   Begin VB.Label lblFile 
      BackColor       =   &H00FFFFFF&
      BorderStyle     =   1  'Fixed Single
      Height          =   255
      Left            =   120
      TabIndex        =   5
      Top             =   240
      Width           =   1815
   End
End
Attribute VB_Name = "fLoad"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub cmd_Click(Index As Integer)
Select Case Index
Case 1
  If IsLoad Then
    Unload Me
    fScenSel.Show
  Else
    Unload Me
    fGameSel.Show
  End If
Case 0
  If IsLoad Then
    If Not Right(lblFile.Caption, 4) = ".wyf" Then Exit Sub
    Open FDir.Path & "\" & lblFile.Caption For Random As #1 Len = Len(gameData)
      Get #1, 1, gameData
    Close #1
    MsgBox "读取完毕!", vbOKOnly, "RoE"
    Unload Me
    fGameSel.Show
  Else
    If Not Right(txtFile.Text, 4) = ".wyf" Then txtFile.Text = txtFile.Text & ".wyf"
    gameData.nameFile = Left(txtFile.Text, Len(txtFile.Text) - 4)
    Open FDir.Path & "\" & STrim(gameData.nameFile) & ".wyf" For Random As #1 Len = Len(gameData)
      Put #1, 1, gameData
    Close #1
    MsgBox "换名完成!", vbOKOnly, "RoE"
    Unload Me
    fGameSel.Show
  End If
End Select
End Sub
Private Sub FDir_Change()
FFile.Path = FDir.Path
End Sub
Private Sub FDrive_Change()
FDir.Path = FDrive.Drive
End Sub
Private Sub FFile_Click()
If IsLoad Then
  lblFile.Caption = FFile.filename
Else
  txtFile.Text = FFile.filename
End If
End Sub
Private Sub Form_Load()
If IsLoad Then
  Me.Caption = "读取存档"
  lblFile.Visible = True
  txtFile.Visible = False
Else
  Me.Caption = "保存文件到……"
  lblFile.Visible = False
  txtFile.Visible = True
End If
Me.Move (Screen.Width - Me.Width) / 2, (Screen.Height - Me.Height) / 2 - 200
FDrive.Drive = Left(App.Path, 2)
FDir.Path = App.Path & "\Sav"
FFile.Path = FDir.Path
End Sub

⌨️ 快捷键说明

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