单项选择题在窗体上画一个名称为Command1的命令按钮,然后编写如下程序:Dim SW As BooleanFunction func(X As Integer) As IntegerIf X<20 ThenY=XElseY=20+XEnd Iffunc=YEnd FunctionPrivate Sub Form_MouseDown(Button As Integer,Shift As Integer,X As Single,Y As Single) SW=FalseEnd SubPdvate Sub Form_MouseUp(Button As Integer,Shift As Integer,X As Single,Y As Single) SW=TrueEnd SubPrivate Sub Command1_Click() Dim intNum As IntegerintNum=InputBox( ) If SW ThenPrint func(intNum) End IfEnd Sub程序运行后,单击命令按钮,将显示一个输入对话框,如果在对话框中输入25,则程序的执行结果为
单项选择题在窗体上画一个命令按钮Command1和两个文本框,名称分别为Text1和Text2。编写如下两个事件过程:Dim Str1 As String,str2 As StringPrivate Sub form_load() Text1.Text= Text2.Text= Text1.Enabled=FalseText2.Enabled=FalseEnd SubPrivate Sub Form_KeyPress(KeyAscii As Integer) str1=str1 & Chr(KeyAscii) End SubPrivate Sub Form_KeyDown(KeyCode As Integer,Shift As Integer) str2=str2 & Chr(KeyCode) End SubPrivate SubCommand1_Click() Text1.Text=str1Text2.Text=str2str1= str2= End Sub当在设计阶段的窗体的KeyPreview属性设置为True时,程序运行过程中,在键盘上输入小写字母abc,然后单击命令按钮,则文本框Text1中显示的内容为