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

📄 frmmain.frm

📁 随机选题软件
💻 FRM
字号:
VERSION 5.00
Begin VB.Form FrmMain 
   BorderStyle     =   0  'None
   Caption         =   "随机选题系统1.0"
   ClientHeight    =   8400
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   11310
   Icon            =   "FrmMain.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   8400
   ScaleWidth      =   11310
   ShowInTaskbar   =   0   'False
   StartUpPosition =   2  '屏幕中心
   WindowState     =   2  'Maximized
   Begin VB.Timer Timer5 
      Enabled         =   0   'False
      Interval        =   1000
      Left            =   3000
      Top             =   5040
   End
   Begin VB.Timer Timer4 
      Enabled         =   0   'False
      Interval        =   100
      Left            =   4920
      Top             =   3960
   End
   Begin VB.Timer Timer3 
      Enabled         =   0   'False
      Interval        =   100
      Left            =   4920
      Top             =   3960
   End
   Begin VB.Timer Timer2 
      Enabled         =   0   'False
      Interval        =   1000
      Left            =   4920
      Top             =   3960
   End
   Begin VB.Timer Timer1 
      Enabled         =   0   'False
      Interval        =   10
      Left            =   8520
      Top             =   6720
   End
   Begin VB.Label Label7 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      BeginProperty Font 
         Name            =   "隶书"
         Size            =   26.25
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FFFF&
      Height          =   525
      Left            =   2430
      TabIndex        =   7
      Top             =   6000
      Width           =   285
   End
   Begin VB.Label Label6 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      BeginProperty Font 
         Name            =   "隶书"
         Size            =   26.25
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FFFF&
      Height          =   525
      Left            =   2430
      TabIndex        =   6
      Top             =   5400
      Width           =   285
   End
   Begin VB.Label Label5 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      BeginProperty Font 
         Name            =   "隶书"
         Size            =   26.25
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FFFF&
      Height          =   525
      Left            =   2430
      TabIndex        =   5
      Top             =   4800
      Width           =   285
   End
   Begin VB.Label Label4 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      BeginProperty Font 
         Name            =   "隶书"
         Size            =   26.25
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FFFF&
      Height          =   525
      Left            =   2430
      TabIndex        =   4
      Top             =   4080
      Width           =   285
   End
   Begin VB.Label Label3 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      BeginProperty Font 
         Name            =   "隶书"
         Size            =   26.25
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FFFF&
      Height          =   525
      Left            =   2430
      TabIndex        =   3
      Top             =   3480
      Width           =   285
   End
   Begin VB.Label LblMain 
      BackStyle       =   0  'Transparent
      Caption         =   "000"
      BeginProperty Font 
         Name            =   "幼圆"
         Size            =   200.25
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   3495
      Left            =   3960
      TabIndex        =   0
      Top             =   3360
      Width           =   6135
   End
   Begin VB.Label Label2 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      BeginProperty Font 
         Name            =   "隶书"
         Size            =   26.25
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FFFF&
      Height          =   525
      Left            =   2430
      TabIndex        =   2
      Top             =   2880
      Width           =   285
   End
   Begin VB.Label Label1 
      AutoSize        =   -1  'True
      BackStyle       =   0  'Transparent
      BeginProperty Font 
         Name            =   "隶书"
         Size            =   26.25
         Charset         =   134
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FFFF&
      Height          =   525
      Index           =   0
      Left            =   720
      TabIndex        =   1
      Top             =   480
      Width           =   285
   End
   Begin VB.Image Image1 
      Height          =   11010
      Left            =   0
      Stretch         =   -1  'True
      Top             =   0
      Width           =   15240
   End
End
Attribute VB_Name = "FrmMain"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim N As Boolean
Dim DB As Database
Dim RS As Recordset
Dim Num As Integer
Dim III As Integer
Dim Wi As Integer
Dim DA As String
Dim Start As Boolean
Dim xxx As Integer, Yanse As Long, TCHU As Integer
Private Sub Form_KeyPress(KeyAscii As Integer)
On Error Resume Next
If KeyAscii = 27 Then
  LblMain.Visible = True
  For i = 0 To xxx
    Label1(i).Visible = False
  Next
  Label2.Visible = False
  Label3.Visible = False
  Label4.Visible = False
  Label5.Visible = False
  Label6.Visible = False
  Label7.Visible = False
  Start = False
  Timer2.Enabled = True
  Image1.Picture = LoadPicture(RS.Fields("tuichu"))
End If
If KeyAscii = 101 Then
  Load FrmEdit
  FrmEdit.Show
  Me.Enabled = False
End If
If KeyAscii = 13 Then
  LblMain.Visible = True
  LblMain_Click
End If
If KeyAscii = 100 Then
If Len(DA) = 1 Then
  If DA = "a" Or DA = "A" Then
   Label2.ForeColor = &HFF&
  End If
  If DA = "b" Or DA = "B" Then
   Label3.ForeColor = &HFF&
  End If
  If DA = "c" Or DA = "C" Then
   Label4.ForeColor = &HFF&
  End If
  If DA = "d" Or DA = "D" Then
   Label5.ForeColor = &HFF&
  End If
  If DA = "e" Or DA = "E" Then
   Label6.ForeColor = &HFF&
  End If
  If DA = "f" Or DA = "F" Then
   Label7.ForeColor = &HFF&
  End If
Else
  For i = 1 To Len(DA)
    If Mid(DA, i, 1) = "a" Or Mid(DA, i, 1) = "A" Then Label2.ForeColor = &HFF&
    If Mid(DA, i, 1) = "b" Or Mid(DA, i, 1) = "B" Then Label3.ForeColor = &HFF&
    If Mid(DA, i, 1) = "c" Or Mid(DA, i, 1) = "C" Then Label4.ForeColor = &HFF&
    If Mid(DA, i, 1) = "d" Or Mid(DA, i, 1) = "D" Then Label5.ForeColor = &HFF&
    If Mid(DA, i, 1) = "e" Or Mid(DA, i, 1) = "E" Then Label6.ForeColor = &HFF&
    If Mid(DA, i, 1) = "f" Or Mid(DA, i, 1) = "F" Then Label7.ForeColor = &HFF&
  Next
End If
End If
End Sub

Private Sub Form_Load()
Start = True
N = False
Timer1.Enabled = False
On Error Resume Next
Set DB = OpenDatabase(App.Path & "\maindb.mdb")
Set RS = DB.OpenRecordset("tiku")
Num = RS.RecordCount
  RS.Edit
  Do Until RS.EOF
    RS.Fields("xuan") = False
    RS.Update
    RS.MoveNext
  Loop
  
RS.Close
DB.Close
End Sub

Private Sub Form_Resize()
Image1.Width = Me.Width
Image1.Height = Me.Height
Image1.Left = 0
Image1.Top = 0
LblMain.Left = Me.Width / 2 - LblMain.Width / 2
LblMain.Top = Me.Height / 2 - LblMain.Height / 2
Set DB = OpenDatabase(App.Path & "\maindb.mdb")
Set RS = DB.OpenRecordset("shezhi")
Image1.Picture = LoadPicture(RS.Fields("beijing"))
LblMain.ForeColor = RS.Fields("yanse")
Label1(0).ForeColor = RS.Fields("yanse")
Label2.ForeColor = RS.Fields("yanse")
Label3.ForeColor = RS.Fields("yanse")
Label4.ForeColor = RS.Fields("yanse")
Label5.ForeColor = RS.Fields("yanse")
Label6.ForeColor = RS.Fields("yanse")
Label7.ForeColor = RS.Fields("yanse")
Yanse = RS.Fields("yanse")
End Sub

Private Sub ChuTi()
  Set DB = OpenDatabase(App.Path & "\maindb.mdb")
  Set RS = DB.OpenRecordset("tiku")
  RS.Move Format(LblMain.Caption) - 1
  If RS.Fields("xuan") <> True Then
    xxx = Len(RS.Fields("timu")) Mod 24
    Label1(0).Caption = Mid(RS.Fields("timu"), 1, 24)
    For i = 1 To xxx
      Load Label1(i)
      Label1(i).Visible = True
      Label1(i).Left = 720
      Label1(i).Top = Label1(i - 1).Top + Label1(i - 1).Height + 20
      Label1(i).Caption = Mid(RS.Fields("timu"), i * 24 + 1, 24)
    Next
    Label2.Caption = "A:" & RS.Fields("daana")
    Label3.Caption = "B:" & RS.Fields("daanb")
    Label4.Caption = "C:" & RS.Fields("daanc")
    Label5.Caption = "D:" & RS.Fields("daand")
    If RS.Fields("daane") <> "" Then Label6.Caption = "E:" & RS.Fields("daane")
    If RS.Fields("daanf") <> "" Then Label7.Caption = "E:" & RS.Fields("daanf")
    Wi = Label1(0).Width
    DA = RS.Fields("daan")
    RS.Edit
    RS.Fields("xuan") = True
    RS.Update
    RS.Close
    DB.Close
    LblMain.Visible = False
  Else
    N = False
    LblMain_Click
  End If
End Sub



Private Sub LblMain_Click()
'On Error Resume Next
Label2.ForeColor = Yanse
Label3.ForeColor = Yanse
Label4.ForeColor = Yanse
Label5.ForeColor = Yanse
Label6.ForeColor = Yanse
Label7.ForeColor = Yanse
If xxx > 0 Then
  For i = 1 To xxx
   Unload Label1(i)
  Next
  xxx = 0
End If
If Start = True Then
If N = False Then
  N = True
  Timer1.Enabled = True
  For i = 0 To xxx
  Label1(i).Caption = ""
  Next
  Label2.Caption = ""
  Label3.Caption = ""
  Label4.Caption = ""
  Label5.Caption = ""
  Label6.Caption = ""
  Label7.Caption = ""
  Timer3.Enabled = False
  Timer4.Enabled = False
Else
  N = False
  Timer1.Enabled = False
  Timer5.Enabled = True

End If
End If
End Sub

Private Sub Timer1_Timer()
Dim CNum As Integer
CNum = Format(LblMain.Caption)
If CNum < Num Then
  If CNum + 1 < 10 Then
    LblMain.Caption = "00" & CNum + 1
  Else
    If CNum + 1 < 100 Then
      LblMain.Caption = "0" & CNum + 1
    End If
  End If
Else
 LblMain.Caption = "001"
End If
End Sub

Private Sub Timer2_Timer()
III = III + 1
CNum = 20 - III
  If CNum < 10 Then
    LblMain.Caption = "00" & CNum
  Else
       LblMain.Caption = "0" & CNum
  End If
  If CNum = 0 Then LblMain.Caption = "000"
If III > 20 Then
End
End If
End Sub

Private Sub Timer5_Timer()
TCHU = TCHU + 1
If TCHU >= 2 Then
  ChuTi
  Timer5.Enabled = False
End If
End Sub

⌨️ 快捷键说明

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