Private Sub Form_Load( )
Open "d:/temp/dat.txt" For Output As #1
Text1.Text=""
E.nd Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii=13 Then
If UCase(Text1.Text)= (14) Then
C.lose #1
E.nd
E.lse
Write #1, (15)
Text1.Text=""
E.nd If
E.nd If
E.nd Sub
以上程序的功能是:在 D 盘 temp 文件夹下建立一个名为 dat.txt 的文件,在文本框中输入字符,每次按
回车键都把当前文本框中的内容写入文件 dat.txt,并清除文本框中的内容:如果输入“END”,则不写入
文件,直接结束程序。请填空。
[试题]在窗体上画1个文本框,名称为Text1,然后编写如下程序:Private Sub Form_Load()Open"d:/temp/dat.txt"For Output As#1Text1.Text=""E.nd SubPrivate Sub Text1_KeyPress(KeyAscii As Integer)lf(13)=13 ThenIf UCase(Text1.Text)=______ThenC.lose 1E.ndE.lseWrite#1,______Text1.Text=""
[单选题]在窗体上画一个文本框,其名称为Text1,然后编写如下事件过程:Private Sub Text1_KeyPress(KeyAscii As Integer)D.im str As StringStr=Chr(KeyAscii)KeyAscii=Asc(UCase (str))Textl.Text=String(2, KeyAscii)E.nd Sub程序运行后,如果在键盘上输入字母"b",则在文本框Text1中显示的内容是A.bbbB.BBBC.BBD.bb
[单选题]在窗体上画一个文本框,其名称为Text1,然后编写如下事件过程: Private Sub Text1_KeyPress(KeyAscii As Integer) Dim sb As String Str=Chr(KcyAscii) KeyAscii=Asc(UCase(str)) Text1.Text=String(2,KeyAscii) End Sub 程序运行后,如果在键盘上输入字母“b”,则在文本框Text1中显示的内容是A.bbbB.BBBC.BBD.bb
[单选题]在窗体上画一个名称为Text1的文本框,并编写如下程序: Private Sub Form_Load() Show Text1.Text=" Text1.SetFocus End Sub Phvate Sub Form_MouseUp(Buuon As Integer,Shift As Integer,X As Single,Y As Single) Phnt“程序设计” End Sub Private Sub Textl_KeyDowA.Visual BasicB.程序设计C.A程序设计D.
[单选题]在窗体上画一个名称为Text1的文本框,并编写如下程序: Private Sub Form Load( ) Show Text1.Text="" Text1.SetFocus End Sub Pfivate Sub Form_MouseUp(BuHon As Integer,Shift As Integer,X As Single,Y As Single) Print“程序设计” End Sub Private Sub Text1_KeyDown(KeyCode As Integer,shi
[单选题]在窗体上画一个名称为Text1的文本框,并编写如下程序: Private Sub Form_Load( ) Show TextText = " " TextSetFocus End Sub Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y _ As Single) Print "程序设计" End Sub Private Sub Text1_Ke!tDown(KeyCode As In
[单选题]在窗体上画一个名称为Text1的文本框,并编写如下程序: Private Sub Form_Load() Show Text1.Text="" Text1.SetFocus End Sub Private Sub Form_MouseUp(Button As Integer,Shift As Integer, X As Single, Y As Single) Print"程序设计" End Sub Private Sub Text1_KeyDown(KeyCode As Integer
[单选题]在窗体上画一个名称为Text1的文本框,并编写如下程序: Private Sub Form_Load() Show Textl.Text="" Textl.Set Focus End Sub Private Sub Form_MouseUp(Button As Inateger,Shift As Integer,X As Single,Y As Single) Frint"程序设计" End Sub Private Sub Textl_KeyDown(KeyCode As InteSer
[单选题]在窗体上画一个名称为Text1的文本框,然后编写如下的事件过程:Pfivate Sub Text1_KeyPress(Keyascii As Integer) … End Sub 若焦点位于文本框中,则能够触发此事件的操作是( )。A.单击文本框B.双击文本框C.单击文本框D.按键盘上的某个键
[单选题]在窗体上画一个名称为Text1的文本框,然后编写如下的事件过程: Private Sub Text1_KeyPress(Keyascii As Integer) ... End Sub 若焦点位于文本框中,则能够触发此事件的操作是( )。A.左键单击文本框B.左键双击文本框C.右键单击文本框D.按下键盘上的某个键