窗体上画了两个按钮按钮Command1和Command2,有如下程序: Private Sub Command1_Click( ) Print "Visual"; End Sub Private Sub Command2_Click( ) Print "Basic"; End Sub Private Sub Form_Load( ) Command2.Cancel = True Command1.Cancel = True End Sub 执行程序后,按键盘Cancel键,在窗体上输出结果是________。
A: Basic
B: Visual
C: Cancel
D: True
A: Basic
B: Visual
C: Cancel
D: True
举一反三
- 工程中有2个窗体,名称分别为Form1、Form2,Form1为启动窗体,该窗体上有命令按钮Command1。要求程序运行后单击该命令按钮时显示Form2,则按钮的Click事件过程应该是______。 A: Private Sub Command1_Click() Form2.Visible End Sub B: Private Sub Command1_Click() Form2.Show End Sub C: Private Sub Command1_Click() Form2.Load End Sub D: Private Sub Command1_Click() Load Form2 End Sub
- 窗体中有3个命令按钮,分别命名为Commandl、Command2和Command3。当单击Cmmandl按钮时,Command2按钮变为可用,Command3按钮变为不可见。下列Commandl的单击事件过程中,正确的是( ) A: Private Sub Command1_Click() Command2.Visible=True Command3.Visible=False End Sub B: Private Sub Command1_Click() Command2.Enabled=True Command3.Enabled=False End Sub C: Private Sub Command1_Click() Command2.Enabled=True Command3.Visible=False End Sub D: Private Sub Command1_Click() Command2.Visible=True Command3.Enabled=False End Sub
- 在窗体上画一个名称为Command 1命令按钮,然后编写如下事件过程: Private Sub Command1_Click() c="ABCD" For n=1 To 4 Print ▁▁▁▁ Next End Sub 程序运行后,单击命令按钮,要求在窗体上显示如下内容: D CD BCD ABCD 则在横线处填入的内容为?
- 工程中有两个窗体,名称分别为Form1、Form2,Form1为启动窗体,该窗体上有命令按翎Command1.要求程序运行后单击该命令按钮时显示Form2,则按钮的Click事件过程应该是 A: Private Sub Command1_Click() B: Form2.Show C: End Sub D: Private Sub Command1_Click() E: Form2.Visible F: End Sub G: Private Sub Command1_Click() H: Load Form2 I: End Sub J: Private Sub Command1_Click() K: Form2.Load L: End Sub
- 窗体中有3个命令按钮,分别命名为Commandl、Command2和Command3。当单击Cmmandl按钮时,Command2按钮变为可用,Command3按钮变为不可见。下列Commandl的单击事件过程中,正确的是( ) A: Private Sub Command1_Click() Command2.Visible=True Command3.Visible=False End Su B: Private Sub Command1_Click() Command2.Enabled=True Command3.Enabled=False End Su C: Private Sub Command1_Click() Command2.Enabled=True Command3.Visible=False End Su D: Private Sub Command1_Click() Command2.Visible=True Command3.Enabled=False End Su