皮皮学,免费搜题
登录
logo - 刷刷题
搜题
【简答题】
阅读以下说明及Visual Basic代码,将应填入(n)处的字句写在对应栏内。 [说明] 下图是一个简易文本编辑器程序的运行界面: 用户打开磁盘上的某个文件后,可以直接对文本进行编辑,也可以利用界面提供的按钮完成相应操作。主要操作介绍如下: (1)打开文件:打开文件对话框,其中仅显示“*.txt”类型的文件。用户选中某一文件后,其内容将呈现于界面文本框内; (2)查找:提示用户输入要查找的内容,将首次出现的查找内容以蓝色高亮标记; (3)替换:若文本框中已选中某段文本,则提示用户输入要替换的内容,在文本框中完成替换。 在开发过程中,文本框名为Text1,“打开文件”、“保存文件”、“查找”、“替换”、“退出”按钮分别命名为Command1至Command5。 [Visual Basic代码] Dim fileName As String Dim fso As New (1), ts As Object ’打开文本文件 Private Sub Command1_Click() CommonDialog1.Filter = '*.txt' CommonDialog1.ShowOpen fileName =(2) ’保存所打开的文件名 Set fso=CreateObjeet('Scripting.FileSystemObject') Set ts=fso.OpenTextFile(fileName, ForReading) If Not ts.AtEndOfStream Then Text1.Text =(3) End If ts. Close End Sub ’保存文本文件 Private Sub Command2_Click() Set ts = fso.OpenTextFile(fileName, ForWriting) (4) ts.Close End Sub ’查找字符串 Private Sub Command3_Cliek() Dim search As String, position As Integer search = InputBox('输入要查找的字符串:') position = InStr(Text1.Text, search) ’在文本中查找字符串 If position >0 Then ’若找到指定的字符串 Text1.SelStart = position - 1 ’设置选定文本的起始位置 Text1.SelLength = Len(search) ’设置选定文本的长度 Else MsgBox '没有发现要查找的字符串' End If End Sub ’替换选中的字符串 Private Sub Command4_Click() Dim object As String If (5) >0 Then ’若已经选中了要替换的文本 object = InputBox('输入要替换的字符串:') Text1.SelText = object ’替换文本 Else MsgBox '请先选中要替换的文本!' End If End Sub ’退出程序 Private Sub Command5_Click() End End Sub
手机使用
分享
复制链接
新浪微博
分享QQ
微信扫一扫
微信内点击右上角“…”即可分享
反馈
参考答案:
举一反三
【简答题】我国公路等级分为 、 、 、 、 五个等级。
【简答题】常见的心血管疾病有哪些?影响心血管健康的因素有哪些?
【单选题】大量大批生产特征不包括:( )
A.
产品品种单一或很少
B.
产品产量很大
C.
产品产量很少或单个
D.
设备利用率高
【单选题】The rules of our school don’t allow _______ at school. That is to say, nobody is allowed _______ here.
A.
to smoke; to
B.
smoking; smoking
C.
to smoke; smoking
D.
smoking; to smoke
【多选题】大量大批生产特征包括:( )
A.
产品品种单一或很少
B.
产品产量很大
C.
产品产量很少或单个
D.
设备利用率高
【简答题】(Para. 7) 3 What did they do while at work?
【单选题】我国公路等级分为( )级。
A.
4
B.
5
【单选题】What did they do while at work? (Para.7)
A.
They met up for dinner, ladies night and sightseeing excursions.
B.
They listened to 90s music, drank their daily Starbucks and served their friendly regulars.
C.
The author taught her co-workers an Australian word of the day and they helped her understand the Canadian use of “eh” at the end of sentences.
D.
Both A and
【多选题】在没有明显糖尿病血管并发症但具有心血管疾病危险因素的2型糖尿病患者中,采取()方式,以预防心血管疾病和糖尿病微血管病变的发生
A.
增加运动,减轻体重;
B.
尽早使用胰岛素;
C.
降糖、降压、调脂;
D.
应用阿司匹林治疗
【单选题】The rules of our school don’t allow ______ at school. That is to say, Nobody is allowed _____ here.
A.
to smoke; to
B.
smoking; smoking
C.
to smoke; smoking
D.
smoking; to smoke
相关题目:
参考解析:
知识点:
题目纠错 0
发布
创建自己的小题库 - 刷刷题