小王基于选择排序算法编写了一个VB程序,功能如下:在文本框 Text1中显示排序前的数据,单击“排序”按钮Command1,在文本框Text2中显示剔除重复数据后的升序排序结果。程序运行界面如图所示。

请回答下列问题
(1)要使程序运行后,命令按钮 Command1的 Caption属性值自动变为“排序”,可在_____(单选,填字母:
A.Text1 Cick()/ | B.Fom_Load()/ | C.Command1_Cick())事件过程中添加语句:Command1 Caption=“排序”。 |
(2)实现上述功能的VB程序如下,请在划线处填入合适的代码。
Const n = 10
Dim a(1 To n) As Integer
Private Sub Form Load ()
‘数组初始化,生成1~20之间的随机整数并赋值给数组a
Randomize '随机数初始化
For i=1 To n
a(i) =
①_______
Next i
End Sub
Private Sub Command1 _Click()
Dim 1 As Integer, j As Integer, t As Integer
Dim bottom As Integer
bottom = n
For i=1 To bottom -1
For j = bottom To i + 1 Step -1
If
②_______ Then
t = a(j):a(j) = a(i):a(i) = t
ElseIf a(j) = a(i) Then
③_______
bottom = bottom -1
End if
Next j
Next i
Text2. text = ""
For i=1 to bottom
Text2. Text = Text2. Text + str(a(i))
Next i
End sub