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

📄 form3.frm

📁 用vb编写的华容道游戏
💻 FRM
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form Form3 
   Caption         =   "取档"
   ClientHeight    =   4320
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   3345
   Icon            =   "Form3.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4320
   ScaleWidth      =   3345
   StartUpPosition =   1  '所有者中心
   Begin VB.Data Data1 
      Caption         =   "Data1"
      Connect         =   "Access"
      DatabaseName    =   ""
      DefaultCursorType=   0  '缺省游标
      DefaultType     =   2  '使用 ODBC
      Exclusive       =   0   'False
      Height          =   375
      Left            =   1200
      Options         =   0
      ReadOnly        =   0   'False
      RecordsetType   =   1  'Dynaset
      RecordSource    =   ""
      Top             =   2520
      Visible         =   0   'False
      Width           =   1140
   End
   Begin VB.Frame Frame1 
      Height          =   4215
      Left            =   120
      TabIndex        =   0
      Top             =   0
      Width           =   3135
      Begin VB.Data Data2 
         Caption         =   "Data2"
         Connect         =   "Access"
         DatabaseName    =   ""
         DefaultCursorType=   0  '缺省游标
         DefaultType     =   2  '使用 ODBC
         Exclusive       =   0   'False
         Height          =   375
         Left            =   1080
         Options         =   0
         ReadOnly        =   0   'False
         RecordsetType   =   1  'Dynaset
         RecordSource    =   ""
         Top             =   1920
         Visible         =   0   'False
         Width           =   1140
      End
      Begin VB.CommandButton Command3 
         Caption         =   "返回"
         Height          =   375
         Left            =   2100
         TabIndex        =   4
         Top             =   3720
         Width           =   950
      End
      Begin VB.CommandButton Command2 
         Caption         =   "删除"
         Height          =   375
         Left            =   1100
         TabIndex        =   3
         Top             =   3720
         Width           =   950
      End
      Begin VB.CommandButton Command1 
         Caption         =   "确定"
         Height          =   375
         Left            =   120
         TabIndex        =   2
         Top             =   3720
         Width           =   950
      End
      Begin VB.TextBox Text1 
         Enabled         =   0   'False
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   400
         Left            =   960
         TabIndex        =   1
         Top             =   240
         Width           =   1935
      End
      Begin MSFlexGridLib.MSFlexGrid MSFlexGrid1 
         Bindings        =   "Form3.frx":030A
         Height          =   2895
         Left            =   120
         TabIndex        =   5
         Top             =   720
         Width           =   2895
         _ExtentX        =   5106
         _ExtentY        =   5106
         _Version        =   393216
         FixedCols       =   0
         FocusRect       =   2
         ScrollBars      =   2
         SelectionMode   =   1
      End
      Begin VB.Label Label1 
         Caption         =   "名称"
         BeginProperty Font 
            Name            =   "宋体"
            Size            =   12
            Charset         =   134
            Weight          =   400
            Underline       =   0   'False
            Italic          =   0   'False
            Strikethrough   =   0   'False
         EndProperty
         Height          =   255
         Left            =   240
         TabIndex        =   6
         Top             =   360
         Width           =   615
      End
   End
End
Attribute VB_Name = "Form3"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Command1_Click()
Dim dd As Integer
    If Trim(Text1.Text) = "" Then
        MsgBox "名称不能为空!"
    Else
        Data2.RecordSource = "select * from save where name=" & "'" & Trim(Text1.Text) & "'"
        Data2.Refresh
                Data1.Database.Execute ("delete * from step")
                Data1.RecordSource = "select * from step"
                Data1.Refresh
                If Data2.Recordset.RecordCount > 0 Then
                Do Until Data2.Recordset.EOF
                Data1.Recordset.AddNew
                Data1.Recordset("aa") = Data2.Recordset("aa")
                Data1.Recordset("b00") = Data2.Recordset("b00")
                Data1.Recordset("b01") = Data2.Recordset("b01")
                Data1.Recordset("b10") = Data2.Recordset("b10")
                Data1.Recordset("b11") = Data2.Recordset("b11")
                Data1.Recordset("b20") = Data2.Recordset("b20")
                Data1.Recordset("b21") = Data2.Recordset("b21")
                Data1.Recordset("b30") = Data2.Recordset("b30")
                Data1.Recordset("b31") = Data2.Recordset("b31")
                Data1.Recordset("b40") = Data2.Recordset("b40")
                Data1.Recordset("b41") = Data2.Recordset("b41")
                Data1.Recordset("b50") = Data2.Recordset("b50")
                Data1.Recordset("b51") = Data2.Recordset("b51")
                Data1.Recordset("b60") = Data2.Recordset("b60")
                Data1.Recordset("b61") = Data2.Recordset("b61")
                Data1.Recordset("b70") = Data2.Recordset("b70")
                Data1.Recordset("b71") = Data2.Recordset("b71")
                Data1.Recordset("b80") = Data2.Recordset("b80")
                Data1.Recordset("b81") = Data2.Recordset("b81")
                Data1.Recordset("b90") = Data2.Recordset("b90")
                Data1.Recordset("b91") = Data2.Recordset("b91")
                Data1.Recordset("a00") = Data2.Recordset("a00")
                Data1.Recordset("a01") = Data2.Recordset("a01")
                Data1.Recordset("a02") = Data2.Recordset("a02")
                Data1.Recordset("a03") = Data2.Recordset("a03")
                Data1.Recordset("a10") = Data2.Recordset("a10")
                Data1.Recordset("a11") = Data2.Recordset("a11")
                Data1.Recordset("a12") = Data2.Recordset("a12")
                Data1.Recordset("a13") = Data2.Recordset("a13")
                Data1.Recordset("a20") = Data2.Recordset("a20")
                Data1.Recordset("a21") = Data2.Recordset("a21")
                Data1.Recordset("a22") = Data2.Recordset("a22")
                Data1.Recordset("a23") = Data2.Recordset("a23")
                Data1.Recordset("a30") = Data2.Recordset("a30")
                Data1.Recordset("a31") = Data2.Recordset("a31")
                Data1.Recordset("a32") = Data2.Recordset("a32")
                Data1.Recordset("a33") = Data2.Recordset("a33")
                Data1.Recordset("a40") = Data2.Recordset("a40")
                Data1.Recordset("a41") = Data2.Recordset("a41")
                Data1.Recordset("a42") = Data2.Recordset("a42")
                Data1.Recordset("a43") = Data2.Recordset("a43")
            
                Data1.UpdateRecord
                Data2.Recordset.MoveNext
                Loop
        load_flag = True
        End If
   
    Data1.RecordSource = "select * from gamer where name=" & "'" & Trim(Text1.Text) & "'"
    Data1.Refresh
    max_step = Data1.Recordset("step1")
    game_num = Data1.Recordset("game")
    MSFlexGrid1.Refresh
    End If
Unload Me
End Sub

Private Sub Command2_Click()
   Data1.Database.Execute ("delete * from gamer where name=" & "'" & Trim(Text1.Text) & "'")
   Data1.Database.Execute ("delete * from save where name=" & "'" & Trim(Text1.Text) & "'")
   Text1.SetFocus
   Text1.Text = ""
   
   MSFlexGrid1.Refresh
   Command1.Enabled = True
   Command2.Enabled = False
   Data1.RecordSource = "select * from gamer order by name"
   Data1.Refresh

End Sub

Private Sub Command3_Click()
load_flag = False
Unload Me
End Sub

Private Sub Form_Load()
Data1.DatabaseName = App.Path & "\data.mdb"
Data2.DatabaseName = App.Path & "\data.mdb"
Data2.RecordSource = "select * from step order by aa"
Data2.Refresh
Data1.RecordSource = "select * from gamer order by name"
Data1.Refresh
With MSFlexGrid1
.ColWidth(0) = 2000

End With
Command2.Enabled = False
End Sub

Private Sub MSFlexGrid1_Click()
Dim int_Current_Row As Integer
    If MSFlexGrid1.Row > 0 And MSFlexGrid1.Row <> MSFlexGrid1.Rows Then
       With MSFlexGrid1
        int_Current_Row = .Row

        Text1.Text = Trim(.TextMatrix(int_Current_Row, 0))
        End With
        Command2.Enabled = True
    End If

End Sub

Private Sub MSFlexGrid1_RowColChange()
Dim int_Current_Row As Integer
    If MSFlexGrid1.Row > 0 And MSFlexGrid1.Row <> MSFlexGrid1.Rows Then
       With MSFlexGrid1
        int_Current_Row = .Row
        Text1.Text = Trim(.TextMatrix(int_Current_Row, 0))
        End With
    End If
'cmd删除.SetFocus
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 13 Or Len(Text1.Text) = Text1.MaxLength - 1 Then
    SendKeys "{TAB}"
End If
End Sub

⌨️ 快捷键说明

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