[RESOLVED] Its there A way to make this code work with .captions?
Hello there, i have this code that mimic a type-Writer effect using the Picturebox, but this doesn't work with .caption =(label1.caption, form1.caption etc.) is give a error that doesn't support this method or something like that.
How can i make this to work with .captions? thanks
Code:
Private Sub Form_Load()
Timer1.Enabled = 0
Timer1.Interval = 60
Timer1.Enabled = 1
End Sub
Private Sub Timer1_Timer()
Static I&
I = I + 1
If I > Len("text Text") Then
'Picture1.Cls
Timer1.Enabled = 0
'I = 0
End If
Picture1.Print Mid("text ext", I, 1);
End Sub
Re: Its there A way to make this code work with .captions?
Code:
Option Explicit
Private Sub Form_Load()
Timer1.Enabled = 0
Timer1.Interval = 60
Timer1.Enabled = 1
End Sub
Private Sub Timer1_Timer()
Static I&
I = I + 1
If I > Len("text Text") Then
'Picture1.Cls
Timer1.Enabled = 0
'I = 0
End If
Me.Print Mid("text ext", I, 1);
'or
Label1.Caption = ""
Label1.Caption = Label1.Caption & Mid("text ext", I, 1)
End Sub
Re: Its there A way to make this code work with .captions?
Originally Posted by MartinLiss
Code:
Option Explicit
Private Sub Form_Load()
Timer1.Enabled = 0
Timer1.Interval = 60
Timer1.Enabled = 1
End Sub
Private Sub Timer1_Timer()
Static I&
I = I + 1
If I > Len("text Text") Then
'Picture1.Cls
Timer1.Enabled = 0
'I = 0
End If
Me.Print Mid("text ext", I, 1);
'or
Label1.Caption = ""
Label1.Caption = Label1.Caption & Mid("text ext", I, 1)
End Sub
Thast the problem, when using the .caption doesn't append the oder characters, only show one character at a time(show one then clear then show the next character etc.)
check the .exe attachment i uploaded. i want to do the same effect that this program do in the Form Caption.
Re: Its there A way to make this code work with .captions?
I stuck the Label1.caption = "" line at the last minute and that's the cause of my code not working. Remove that line and if needed put it someplace else.
Re: Its there A way to make this code work with .captions?
Originally Posted by MartinLiss
I stuck the Label1.caption = "" line at the last minute and that's the cause of my code not working. Remove that line and if needed put it someplace else.
Yep, that was the problem, now works for any .captions.Thanks