编写一个过程把C盘中的Config. sys文件内容读出,并在文本框中显示出来。在窗体Form1建立一个文本框Text1,将其MultiLine属性设置为True,将ScrollBars属性设置为3-Both。根据题意。请完善下列程序。 option Explicit Private Sub Form. C1ick() Dim chl As String, fn As Integer Dim Str As String fn=【 】 Open "C:\Config. sys" For Input As fn Do While Not EOF(【 】) Line Input fn, chl Str=Str+chl+vbCrLf Loop Text1. Text=【 】 End Sub
把窗体的KeyPreview属性设置为True,然后编写如下两个事件过程: Prirate Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) Print Chr(Keycode) End Sub Private Sub Form_KeyPress(KeyAscii As Integer) Print Chr(KeyAscii) End Sub 程序运行后,如果直接按键盘上的“A”键(即不按住Shift键),则在窗体上输出的字符分别是【 】和【 】。