vb的:事先在d盘创建一个test文件夹,用windows自带的记事本输入一首诗,并命名为tangshi
PrivateSubForm_Click()DimtxtlineAsStringDimwholetxtAsStringOpen"d:/test/tangshi.txt"F...
Private Sub Form_Click()
Dim txtline As String
Dim wholetxt As String
Open "d:/test/tangshi.txt" For Input As #1
Do While Not EOF(1)
Line Input #1, txtline
wholetxt = wholetxt + txtline + Chr$(10) + Chr$(13)
Text1.Text = wholetxt
Loop
Close #1
End Sub
我在记事本中输入唐诗,是标准的格式,有五排,但是vb运行时,文字显示在一排了,chr$(13)+chr$(10)貌似没有运行,是不是?
另外,我怎样才能使它呈现我在记事本中输入的样子一样? 展开
Dim txtline As String
Dim wholetxt As String
Open "d:/test/tangshi.txt" For Input As #1
Do While Not EOF(1)
Line Input #1, txtline
wholetxt = wholetxt + txtline + Chr$(10) + Chr$(13)
Text1.Text = wholetxt
Loop
Close #1
End Sub
我在记事本中输入唐诗,是标准的格式,有五排,但是vb运行时,文字显示在一排了,chr$(13)+chr$(10)貌似没有运行,是不是?
另外,我怎样才能使它呈现我在记事本中输入的样子一样? 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询