| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 578 人关注过本帖
标题:急!如何在text控件中显示打开的文本
只看楼主 加入收藏
kevinhong
Rank: 1
等 级:新手上路
帖 子:36
专家分:0
注 册:2005-7-15
收藏
 问题点数:0 回复次数:1 
急!如何在text控件中显示打开的文本
请问大家,如果将准备打开的txt文件在VB文本框text控件显示出来?谢谢!
搜索更多相关主题的帖子: text 控件 文本 
2005-12-06 09:40
griefforyou
Rank: 6Rank: 6
等 级:贵宾
威 望:27
帖 子:3336
专家分:0
注 册:2004-4-15
收藏
得分:0 

'下面是我的一个程序中“加载”按钮的代码
Private Sub cmdLoad_Click()
Dim FileName As String
Dim FileNum As Integer
Dim strData As String


FileName = OpenFile(Me.hWnd, "Mail List Files|*.txt|All Files|*.*", 0)
If FileName <> "" Then
txtMailList = ""
FileNum = FreeFile
Open FileName For Input As #FileNum
While Not EOF(FileNum)
Line Input #FileNum, strData
txtMailList.Text = txtMailList.Text & strData & vbCrLf
Wend
Close #FileNum

If Right(txtMailList, 2) = vbCrLf Then
txtMailList.Text = Left(txtMailList.Text, Len(txtMailList.Text) - 2)
End If
End If

End Sub


天津网站建设 http://www./
2005-12-06 10:10
快速回复:急!如何在text控件中显示打开的文本
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.022121 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved