29-04-13, 04:16 AM
السلام عليكم
- هذا كودي السابق بعد شوي تعديل . أضف لست بوكس ثانية لكي تحمل فيها محتوى الملف النصي لكي نأخذ سطر سطر ونظهره في التكست . وأضف تايمر لكي يظهر كل ثانية سطر من اللست بوكس الثانية :
- هذا كودي السابق بعد شوي تعديل . أضف لست بوكس ثانية لكي تحمل فيها محتوى الملف النصي لكي نأخذ سطر سطر ونظهره في التكست . وأضف تايمر لكي يظهر كل ثانية سطر من اللست بوكس الثانية :
كود :
Private Sub Command1_Click()
If Trim$(List1.Text) <> "" Then
If Dir$(Trim$(List1.Text)) <> "" Then
Dim F As Integer
Dim CurrentLine As String
List2.Clear
F = FreeFile
Open Trim$(List1.Text) For Input As #F
While Not EOF(F)
Line Input #F, CurrentLine
If Trim$(CurrentLine) <> "" Then
List2.AddItem Trim$(CurrentLine)
End If
Wend
Close #F
Timer1.Enabled = True
Else
MsgBox "الملف غير موجود"
End If
Else
MsgBox "حدد الملف في اللست بوكس"
End If
End Sub
Private Sub Timer1_Timer()
Static I As Integer
If List2.ListCount > 0 And I <= List2.ListCount - 1 Then
Text1.Text = Trim$(List2.List(I))
I = I + 1
Else
I = 0
Timer1.Enabled = False
End If
End Sub
