📄 编程补充题1.frm
字号:
VERSION 5.00
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 3195
ClientLeft = 60
ClientTop = 345
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3195
ScaleWidth = 4680
StartUpPosition = 3 '窗口缺省
Begin VB.TextBox Text1
Alignment = 2 'Center
Height = 375
Index = 1
Left = 1920
TabIndex = 1
Top = 480
Width = 735
End
Begin VB.TextBox Text1
Alignment = 2 'Center
Height = 375
Index = 11
Left = 3360
TabIndex = 11
Top = 2280
Width = 735
End
Begin VB.TextBox Text1
Alignment = 2 'Center
Height = 375
Index = 10
Left = 1920
TabIndex = 10
Top = 2280
Width = 735
End
Begin VB.TextBox Text1
Alignment = 2 'Center
Height = 375
Index = 9
Left = 480
TabIndex = 9
Top = 2280
Width = 735
End
Begin VB.TextBox Text1
Alignment = 2 'Center
Height = 375
Index = 8
Left = 3360
TabIndex = 8
Top = 1680
Width = 735
End
Begin VB.TextBox Text1
Alignment = 2 'Center
Height = 375
Index = 7
Left = 1920
TabIndex = 7
Top = 1680
Width = 735
End
Begin VB.TextBox Text1
Alignment = 2 'Center
Height = 375
Index = 6
Left = 480
TabIndex = 6
Top = 1680
Width = 735
End
Begin VB.TextBox Text1
Alignment = 2 'Center
Height = 375
Index = 5
Left = 3360
TabIndex = 5
Top = 1080
Width = 735
End
Begin VB.TextBox Text1
Alignment = 2 'Center
Height = 375
Index = 4
Left = 1920
TabIndex = 4
Top = 1080
Width = 735
End
Begin VB.TextBox Text1
Alignment = 2 'Center
Height = 375
Index = 3
Left = 480
TabIndex = 3
Top = 1080
Width = 735
End
Begin VB.TextBox Text1
Alignment = 2 'Center
Height = 375
Index = 2
Left = 3360
TabIndex = 2
Top = 480
Width = 735
End
Begin VB.TextBox Text1
Alignment = 2 'Center
Height = 375
Index = 0
Left = 480
TabIndex = 0
Top = 480
Width = 735
End
Begin VB.Label Label1
Caption = "座位分配表"
BeginProperty Font
Name = "宋体"
Size = 14.25
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 1560
TabIndex = 12
Top = 120
Width = 1455
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Private Sub Form_Load()
Dim t(12) As String
Randomize
For k = 1 To 12
t(k) = "Empty" '初始安排12个位置均为"Empty"
Next k
For h = 65 To 74 '代表"A"至"J",每次随机安排一个字母
Do While True '随机查找一个空位
p = Int(1 + 12 * Rnd) '产生1~12随机数
If t(p) = "Empty" Then
t(p) = Chr(h)
Exit Do
End If
Loop
Next h
For k = 1 To 12
Text1(k - 1).Text = t(k) '显示座位分配情况
Next k
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -