📄 frmgame.vb
字号:
Public Class FrmGame
Inherits System.Windows.Forms.Form
Dim flag As Boolean
Dim frm1 As New FrmPlayer
Dim count As Integer = 0
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
End Sub
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Friend WithEvents Btn1 As System.Windows.Forms.Button
Friend WithEvents Btn2 As System.Windows.Forms.Button
Friend WithEvents Btn3 As System.Windows.Forms.Button
Friend WithEvents Btn4 As System.Windows.Forms.Button
Friend WithEvents Btn5 As System.Windows.Forms.Button
Friend WithEvents Btn6 As System.Windows.Forms.Button
Friend WithEvents Btn7 As System.Windows.Forms.Button
Friend WithEvents Btn8 As System.Windows.Forms.Button
Friend WithEvents Btn9 As System.Windows.Forms.Button
Friend WithEvents lblanswer As System.Windows.Forms.Label
Friend WithEvents LblQuestion As System.Windows.Forms.Label
Friend WithEvents PictureBox1 As System.Windows.Forms.PictureBox
Friend WithEvents OleDbSelectCommand1 As System.Data.OleDb.OleDbCommand
Friend WithEvents OleDbInsertCommand1 As System.Data.OleDb.OleDbCommand
Friend WithEvents OleDbUpdateCommand1 As System.Data.OleDb.OleDbCommand
Friend WithEvents OleDbDeleteCommand1 As System.Data.OleDb.OleDbCommand
Friend WithEvents OleDbConnection1 As System.Data.OleDb.OleDbConnection
Friend WithEvents OleDbDataAdapter1 As System.Data.OleDb.OleDbDataAdapter
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(FrmGame))
Me.Btn1 = New System.Windows.Forms.Button
Me.Btn2 = New System.Windows.Forms.Button
Me.Btn3 = New System.Windows.Forms.Button
Me.Btn4 = New System.Windows.Forms.Button
Me.Btn5 = New System.Windows.Forms.Button
Me.Btn6 = New System.Windows.Forms.Button
Me.Btn7 = New System.Windows.Forms.Button
Me.Btn8 = New System.Windows.Forms.Button
Me.Btn9 = New System.Windows.Forms.Button
Me.lblanswer = New System.Windows.Forms.Label
Me.LblQuestion = New System.Windows.Forms.Label
Me.PictureBox1 = New System.Windows.Forms.PictureBox
Me.OleDbSelectCommand1 = New System.Data.OleDb.OleDbCommand
Me.OleDbInsertCommand1 = New System.Data.OleDb.OleDbCommand
Me.OleDbUpdateCommand1 = New System.Data.OleDb.OleDbCommand
Me.OleDbDeleteCommand1 = New System.Data.OleDb.OleDbCommand
Me.OleDbConnection1 = New System.Data.OleDb.OleDbConnection
Me.OleDbDataAdapter1 = New System.Data.OleDb.OleDbDataAdapter
Me.SuspendLayout()
'
'Btn1
'
Me.Btn1.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Btn1.Location = New System.Drawing.Point(48, 43)
Me.Btn1.Name = "Btn1"
Me.Btn1.Size = New System.Drawing.Size(32, 32)
Me.Btn1.TabIndex = 0
Me.Btn1.TabStop = False
'
'Btn2
'
Me.Btn2.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Btn2.Location = New System.Drawing.Point(80, 43)
Me.Btn2.Name = "Btn2"
Me.Btn2.Size = New System.Drawing.Size(32, 32)
Me.Btn2.TabIndex = 1
Me.Btn2.TabStop = False
'
'Btn3
'
Me.Btn3.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Btn3.Location = New System.Drawing.Point(112, 43)
Me.Btn3.Name = "Btn3"
Me.Btn3.Size = New System.Drawing.Size(32, 32)
Me.Btn3.TabIndex = 2
Me.Btn3.TabStop = False
'
'Btn4
'
Me.Btn4.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Btn4.Location = New System.Drawing.Point(48, 75)
Me.Btn4.Name = "Btn4"
Me.Btn4.Size = New System.Drawing.Size(32, 32)
Me.Btn4.TabIndex = 3
Me.Btn4.TabStop = False
'
'Btn5
'
Me.Btn5.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Btn5.Location = New System.Drawing.Point(80, 75)
Me.Btn5.Name = "Btn5"
Me.Btn5.Size = New System.Drawing.Size(32, 32)
Me.Btn5.TabIndex = 4
Me.Btn5.TabStop = False
'
'Btn6
'
Me.Btn6.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Btn6.Location = New System.Drawing.Point(112, 75)
Me.Btn6.Name = "Btn6"
Me.Btn6.Size = New System.Drawing.Size(32, 32)
Me.Btn6.TabIndex = 5
Me.Btn6.TabStop = False
'
'Btn7
'
Me.Btn7.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Btn7.Location = New System.Drawing.Point(48, 107)
Me.Btn7.Name = "Btn7"
Me.Btn7.Size = New System.Drawing.Size(32, 32)
Me.Btn7.TabIndex = 6
Me.Btn7.TabStop = False
'
'Btn8
'
Me.Btn8.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Btn8.Location = New System.Drawing.Point(80, 107)
Me.Btn8.Name = "Btn8"
Me.Btn8.Size = New System.Drawing.Size(32, 32)
Me.Btn8.TabIndex = 7
Me.Btn8.TabStop = False
'
'Btn9
'
Me.Btn9.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Btn9.Location = New System.Drawing.Point(112, 107)
Me.Btn9.Name = "Btn9"
Me.Btn9.Size = New System.Drawing.Size(32, 32)
Me.Btn9.TabIndex = 9
Me.Btn9.TabStop = False
'
'PictureBox1
'
Me.PictureBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle
Me.PictureBox1.Location = New System.Drawing.Point(24, 24)
Me.PictureBox1.Name = "PictureBox1"
Me.PictureBox1.Size = New System.Drawing.Size(144, 136)
Me.PictureBox1.TabIndex = 10
Me.PictureBox1.TabStop = False
'
'OleDbSelectCommand1
'
Me.OleDbSelectCommand1.CommandText = "SELECT Answer, Levelnum, [Number], Question FROM Questions"
Me.OleDbSelectCommand1.Connection = Me.OleDbConnection1
'
'OleDbInsertCommand1
'
Me.OleDbInsertCommand1.CommandText = "INSERT INTO Questions(Answer, Levelnum, Question) VALUES (?, ?, ?)"
Me.OleDbInsertCommand1.Connection = Me.OleDbConnection1
Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Answer", System.Data.OleDb.OleDbType.VarWChar, 50, "Answer"))
Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Levelnum", System.Data.OleDb.OleDbType.VarWChar, 50, "Levelnum"))
Me.OleDbInsertCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Question", System.Data.OleDb.OleDbType.VarWChar, 50, "Question"))
'
'OleDbUpdateCommand1
'
Me.OleDbUpdateCommand1.CommandText = "UPDATE Questions SET Answer = ?, Levelnum = ?, Question = ? WHERE ([Number] = ?) " & _
"AND (Answer = ? OR ? IS NULL AND Answer IS NULL) AND (Levelnum = ? OR ? IS NULL " & _
"AND Levelnum IS NULL) AND (Question = ? OR ? IS NULL AND Question IS NULL)"
Me.OleDbUpdateCommand1.Connection = Me.OleDbConnection1
Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Answer", System.Data.OleDb.OleDbType.VarWChar, 50, "Answer"))
Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Levelnum", System.Data.OleDb.OleDbType.VarWChar, 50, "Levelnum"))
Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Question", System.Data.OleDb.OleDbType.VarWChar, 50, "Question"))
Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Number", System.Data.OleDb.OleDbType.Integer, 0, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Number", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Answer", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Answer", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Answer1", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Answer", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Levelnum", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Levelnum", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Levelnum1", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Levelnum", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Question", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Question", System.Data.DataRowVersion.Original, Nothing))
Me.OleDbUpdateCommand1.Parameters.Add(New System.Data.OleDb.OleDbParameter("Original_Question1", System.Data.OleDb.OleDbType.VarWChar, 50, System.Data.ParameterDirection.Input, False, CType(0, Byte), CType(0, Byte), "Question", System.Data.DataRowVersion.Original, Nothing))
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -