第一次调用文本时显示正常,退出后,再次进入时便显示不了,得按下一页才可显示.
代码如下:Public Function filegeter(file_path As String) As String
Dim lstr As String, lstrall As String
Open file_path For Input As #1
While Not EOF(1)
Line Input #1, lstr
lstrall = lstrall + lstr + Chr(13)
Wend
Close #1
filegeter = lstrall
If Len(lstrall) < 3 Then filegeter = Space(20)
End FunctionPrivate Sub Form_Load()
'Me.Picture = LoadPicture(App.Path & "\pic\textshow.bmp") '在此添入背景图路径
Me.Height = Screen.Height
Me.Width = Screen.Width
Me.Left = 0
Me.Top = 0
'Flash1.Movie = App.Path & "\fla\logo2.swf"
Call textshow.PaintPicture(Me.Picture, 0, 0, textshow.Width, textshow.Height, textshow.Left, textshow.Top, textshow.Width, textshow.Height, vbSrcCopy)
mstr_total = filegeter(gstrpath) '显示的文本
textshowtemp.Picture = textshow.Image
textshowcls.Picture = textshow.Image
textshow.AutoRedraw = False
mint_now_pst = 1
mint_max_pst = 0
mint_charinfile_counted = 0
End SubPrivate Sub getpst()
Dim now_countcharcopy As Long '用来保存当前的mint_max_pst,以便确定当前的数组中的字符个数
Dim strtemp_in_group As String '当前用来显示的字符集合
Dim exit_thiswhile As Boolean '确定是否换行了,若换了就退出当前循环以便判断是否文本越界
Dim strtemp_in_grouptemp As String '保存当前strtemp_in_group,以便strtemp_in_group更改后可以确定当前数组的字符个数
exit_thiswhile = False
If mint_now_pst <= mint_max_pst Then
   strtemp_in_group = mpagegroup(mint_now_pst)
Else
   If mint_charinfile_counted < Len(mstr_total) Then
      strtemp_in_group = Right(mstr_total, Len(mstr_total) - mint_charinfile_counted)
      strtemp_in_grouptemp = strtemp_in_group
      now_countcharcopy = mint_charinfile_counted
   Else
      strtemp_in_group = mpagegroup(mint_max_pst)
      mint_now_pst = mint_max_pst
   End If
End If
textshowtemp.Cls
While Len(strtemp_in_group) > 0 And (textshowtemp.CurrentY + 600 < textshowtemp.Height)
If Not exit_thiswhile Then
textshowtemp.Print
textshowtemp.CurrentX = textshowtemp.CurrentX + 200
textshowtemp.CurrentY = textshowtemp.CurrentY + 100
End If
exit_thiswhile = False
While ((Len(strtemp_in_group) > 0) And (textshowtemp.CurrentX + 400 < textshowtemp.Width) And (Not (exit_thiswhile)))
textshowtemp.Print Left(strtemp_in_group, 1);
If mint_now_pst > mint_max_pst Then mint_charinfile_counted = mint_charinfile_counted + 1
If textshowtemp.Width - textshowtemp.CurrentX > textshowtemp.Width - 2 Then
textshowtemp.CurrentX = textshowtemp.CurrentX + 200
textshowtemp.CurrentY = textshowtemp.CurrentY + 100
exit_thiswhile = True
End If
If Len(strtemp_in_group) > 0 Then
strtemp_in_group = Right(strtemp_in_group, Len(strtemp_in_group) - 1)
End If
Wend
Wend
If mint_now_pst > mint_max_pst Then
mint_max_pst = mint_max_pst + 1
mpagegroup(mint_max_pst) = Left(strtemp_in_grouptemp, mint_charinfile_counted - now_countcharcopy)
End If
textshowtemp.Refresh
'textshowtemp.Picture = textshowtemp.Image
End SubPrivate Sub Form_Unload(Cancel As Integer)
Set Form2 = Nothing
End SubPrivate Sub Label1_Click(Index As Integer)
Dim pid As Long
Select Case Index
Case 0
If mint_now_pst > 1 Then
mint_now_pst = mint_now_pst - 1
Call getpst
Call textshowmode
End If
Case 1
If mint_charinfile_counted < Len(mstr_total) Then
mint_now_pst = mint_now_pst + 1
Call getpst
Call textshowmode
Else
 If mint_now_pst < mint_max_pst Then mint_now_pst = mint_now_pst + 1
 Call getpst
 Call textshowmode
End If
Case 2Unload Me
Form1.ShowEnd Select
End SubPrivate Sub textshow_Click()End SubPrivate Sub Timer1_Timer()
Call getpst
Call textshowmode
Timer1.Enabled = False
End Sub