dbotton
Messages postés15Date d'inscriptiondimanche 30 novembre 2003StatutMembreDernière intervention23 novembre 2006 21 juil. 2005 à 14:20
Tres bien avec la correction en question.
2 questions:
- est-il posible de le mettre en boucle pour que ce recommence apres quelques secondes quand c' est terminé.
- j' aimerais le travailler pour ajouter des images en plus du texte mais je ne sais pas comment m'y prendre. Des pistes ?
cs_PaTaTe
Messages postés2126Date d'inscriptionmercredi 21 août 2002StatutContributeurDernière intervention19 février 20212 20 nov. 2002 à 06:39
Ca serait bien si la form se dechargeait à la fin du défilement. Je travailla à ca.
J'ai aussi retiré un bug.
Il faut mettre le textbox en invisible
Activer la visibilité du textbox juste apres l'activation du timer.
Cela evite des clignotements dans le cas de fichiers texte volumineux.
Je colle ici les modif du codes :
Private Sub Form_Load()
Dim sChaine As String
Dim PTextStream As TextStream
Dim PFileSystemObject As FileSystemObject
Set PFileSystemObject = New FileSystemObject
With cdg
.FileName = ""
.Filter = "Fichiers Texte (*.txt)|*.txt"
.DialogTitle = "Ouvrir un fichier texte..."
On Error GoTo erreur
.CancelError = True
.ShowOpen
If .FileName <> "" Then
Set PTextStream = PFileSystemObject.OpenTextFile(.FileName, ForReading)
Text1.Text = PTextStream.ReadAll
PTextStream.Close
Set PTextStream = Nothing
Text1.Top = Me.Height * 2 'Me.ScaleHeight / 2
Timer1.Enabled = True
Text1.Visible = True
End If
End With
Exit Sub
erreur:
End
End Sub
Private Sub Form_Resize()
Text1.Left = 0
Text1.Width = Me.ScaleWidth
Text1.Height = Me.ScaleHeight + 1000
toto = Text1.Height
End Sub
Private Sub Text1_DblClick()
End
End Sub
Private Sub Text1_GotFocus()
Command1.SetFocus
End Sub
Private Sub Text1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
If Timer1.Enabled Then
Timer1.Enabled = False
Else
Timer1.Enabled = True
End If
End If
End Sub
Private Sub Timer1_Timer()
Text1.Top = Text1.Top - 5
Text1.Height = Text1.Height + Abs(Text1.Top)
End Sub
21 juil. 2005 à 14:20
2 questions:
- est-il posible de le mettre en boucle pour que ce recommence apres quelques secondes quand c' est terminé.
- j' aimerais le travailler pour ajouter des images en plus du texte mais je ne sais pas comment m'y prendre. Des pistes ?
20 nov. 2002 à 06:39
J'ai aussi retiré un bug.
Il faut mettre le textbox en invisible
Activer la visibilité du textbox juste apres l'activation du timer.
Cela evite des clignotements dans le cas de fichiers texte volumineux.
Je colle ici les modif du codes :
Private Sub Form_Load()
Dim sChaine As String
Dim PTextStream As TextStream
Dim PFileSystemObject As FileSystemObject
Set PFileSystemObject = New FileSystemObject
With cdg
.FileName = ""
.Filter = "Fichiers Texte (*.txt)|*.txt"
.DialogTitle = "Ouvrir un fichier texte..."
On Error GoTo erreur
.CancelError = True
.ShowOpen
If .FileName <> "" Then
Set PTextStream = PFileSystemObject.OpenTextFile(.FileName, ForReading)
Text1.Text = PTextStream.ReadAll
PTextStream.Close
Set PTextStream = Nothing
Text1.Top = Me.Height * 2 'Me.ScaleHeight / 2
Timer1.Enabled = True
Text1.Visible = True
End If
End With
Exit Sub
erreur:
End
End Sub
Private Sub Form_Resize()
Text1.Left = 0
Text1.Width = Me.ScaleWidth
Text1.Height = Me.ScaleHeight + 1000
toto = Text1.Height
End Sub
Private Sub Text1_DblClick()
End
End Sub
Private Sub Text1_GotFocus()
Command1.SetFocus
End Sub
Private Sub Text1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
If Timer1.Enabled Then
Timer1.Enabled = False
Else
Timer1.Enabled = True
End If
End If
End Sub
Private Sub Timer1_Timer()
Text1.Top = Text1.Top - 5
Text1.Height = Text1.Height + Abs(Text1.Top)
End Sub
C'etait bien trouvé ! Merci !
[PaTaTe]