form1.frm

来自「模拟36选7和双色球的随机选票 比较简单」· FRM 代码 · 共 315 行

FRM
315
字号
VERSION 5.00
Begin VB.Form Form1 
   Caption         =   "模拟彩票选票程序"
   ClientHeight    =   4515
   ClientLeft      =   60
   ClientTop       =   450
   ClientWidth     =   7620
   LinkTopic       =   "Form1"
   ScaleHeight     =   4515
   ScaleWidth      =   7620
   StartUpPosition =   3  '窗口缺省
   Begin VB.ComboBox Combo2 
      Height          =   300
      Left            =   4440
      TabIndex        =   11
      Text            =   "Combo2"
      Top             =   2640
      Width           =   2775
   End
   Begin VB.ComboBox Combo1 
      Height          =   300
      Left            =   360
      TabIndex        =   10
      Text            =   "Combo1"
      Top             =   2640
      Width           =   2775
   End
   Begin VB.CommandButton Command1 
      Caption         =   "双色球"
      Height          =   735
      Left            =   840
      Style           =   1  'Graphical
      TabIndex        =   2
      Top             =   1440
      Width           =   1335
   End
   Begin VB.CommandButton Command2 
      Caption         =   "退出"
      Height          =   735
      Left            =   5520
      Style           =   1  'Graphical
      TabIndex        =   1
      Top             =   3480
      Width           =   1455
   End
   Begin VB.CommandButton Command3 
      Caption         =   "36选7"
      Height          =   735
      Left            =   5160
      Style           =   1  'Graphical
      TabIndex        =   0
      Top             =   1440
      Width           =   1455
   End
   Begin VB.Label Label1 
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "清空"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   15.75
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FF80FF&
      Height          =   495
      Left            =   120
      TabIndex        =   9
      Top             =   480
      Width           =   975
   End
   Begin VB.Label Label2 
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "清空"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   15.75
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FF80FF&
      Height          =   495
      Left            =   1080
      TabIndex        =   8
      Top             =   480
      Width           =   975
   End
   Begin VB.Label Label3 
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "清空"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   15.75
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FF80FF&
      Height          =   495
      Left            =   2160
      TabIndex        =   7
      Top             =   480
      Width           =   975
   End
   Begin VB.Label Label4 
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "清空"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   15.75
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FF80FF&
      Height          =   495
      Left            =   3240
      TabIndex        =   6
      Top             =   480
      Width           =   975
   End
   Begin VB.Label Label5 
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "清空"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   15.75
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FF80FF&
      Height          =   495
      Left            =   4320
      TabIndex        =   5
      Top             =   480
      Width           =   975
   End
   Begin VB.Label Label6 
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "清空"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   15.75
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FF80FF&
      Height          =   375
      Left            =   5400
      TabIndex        =   4
      Top             =   480
      Width           =   975
   End
   Begin VB.Label Label7 
      Alignment       =   2  'Center
      BackStyle       =   0  'Transparent
      Caption         =   "清空"
      BeginProperty Font 
         Name            =   "宋体"
         Size            =   15.75
         Charset         =   134
         Weight          =   400
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00FFFF80&
      Height          =   375
      Left            =   6480
      TabIndex        =   3
      Top             =   480
      Width           =   975
   End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Private Sub Command1_Click()
Dim q As Integer, a As Integer, b As Integer, c As Integer, d As Integer, e As Integer, f As Integer, g As Integer
  For q = 1 To 7
    Select Case q
      Case Is = 1
       Randomize (Timer)
        a = Int(Rnd * 33 + 1)
        Label1.Caption = a
  Case Is = 2
    Do
     Randomize (Timer)
     b = Int(Rnd * 33 + 1)
    Loop Until b <> Label1.Caption
    Label2.Caption = b
  Case Is = 3
    Do
      Randomize (Timer)
      c = Int(Rnd * 33 + 1)
    Loop Until c <> Label1.Caption And c <> Label2.Caption
    Label3.Caption = c
  Case Is = 4
    Do
      Randomize (Timer)
      d = Int(Rnd * 33 + 1)
    Loop Until d <> Label1.Caption And d <> Label2.Caption And d <> Label3.Caption
    Label4.Caption = d
  Case Is = 5
    Do
      Randomize (Timer)
      e = Int(Rnd * 33 + 1)
    Loop Until e <> Label1.Caption And e <> Label2.Caption And e <> Label3.Caption And e <> Label4.Caption
      Label5.Caption = e
  Case Is = 6
    Do
      Randomize (Timer)
      f = Int(Rnd * 33 + 1)
    Loop Until f <> Label1.Caption And f <> Label2.Caption And f <> Label3.Caption And f <> Label4.Caption And _
f <> Label5.Caption
    Label6.Caption = f
  Case Is = 7
      Randomize (Timer)
      g = Int(Rnd * 16 + 1)
      Label7.Caption = g
      Case Else
  End Select
  Next
  Dim w As Variant
  w = a & " " & b & " " & c & " " & d & " " & e & " " & f & "-" & g
  Combo1.Text = w
  Combo1.AddItem w, 0
End Sub

Private Sub Command2_Click()
Unload Me
End Sub

Private Sub Command3_Click()
Dim q As Integer, a As Integer, b As Integer, c As Integer, d As Integer, e As Integer, f As Integer, g As Integer
   For q = 1 To 7
     Select Case q
       Case Is = 1
         Randomize (Timer)
         a = Int(Rnd * 36 + 1)
         Label1.Caption = a
       Case Is = 2
         Do
         Randomize (Timer)
         b = Int(Rnd * 36 + 1)
       Loop Until b <> Label1.Caption
       Label2.Caption = b
       Case Is = 3
         Do
         Randomize (Timer)
         c = Int(Rnd * 36 + 1)
         Loop Until c <> Label1.Caption And c <> Label2.Caption
    Label3.Caption = c
  Case Is = 4
    Do
      Randomize (Timer)
      d = Int(Rnd * 36 + 1)
    Loop Until d <> Label1.Caption And d <> Label2.Caption And d <> Label3.Caption
    Label4.Caption = d
  Case Is = 5
    Do
      Randomize (Timer)
      e = Int(Rnd * 36 + 1)
    Loop Until e <> Label1.Caption And e <> Label2.Caption And e <> Label3.Caption And e <> Label4.Caption
      Label5.Caption = e
  Case Is = 6
    Do
      Randomize (Timer)
      f = Int(Rnd * 36 + 1)
    Loop Until f <> Label1.Caption And f <> Label2.Caption And f <> Label3.Caption And f <> Label4.Caption And _
f <> Label5.Caption
    Label6.Caption = f
  Case Is = 7
    Do
      Randomize (Timer)
      g = Int(Rnd * 36 + 1)
      Loop Until g <> Label1.Caption And g <> Label2.Caption And g <> Label3.Caption And g <> Label4.Caption And _
g <> Label5.Caption
      Label7.Caption = g
  End Select
  Next
  Dim y As Variant
  y = a & " " & b & " " & c & " " & d & " " & e & " " & f & " " & g
  Combo2.Text = y
  Combo2.AddItem y, 0
         
         
End Sub

⌨️ 快捷键说明

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