|
-
Mar 2nd, 2002, 03:40 AM
#1
Thread Starter
Member
-
Mar 2nd, 2002, 05:53 AM
#2
Lively Member
Well.... You could have the text box, and then put a blank label on top. Then, using ONE timer, move the left of the blank label across, so it shows a bit of the message at one time.
Put the following in the timer part
EG:
Code:
' This part says that if the blank label left is below the Form1 left * width then continue moving it, else, stop moving it to save system rersources)
If blnklbl1.left > (form1.left * form1.width) then
blnklbl1.left = blnklbl1.left - 100
else:
timer1.enabled = false
Hope that helps!
If not, tell me and I will try a different way!!
Ich widerstehe allem - nur nicht der Versuchung
(I can resist anything but temptation)
-
Mar 2nd, 2002, 08:24 AM
#3
Plenderj and Arbiter argued about this in a thread recently. you should be able to find it if you do a search.
(incidentally they had almost identical code, and I think it was very similar to jamieoboth's)
-
Mar 2nd, 2002, 08:51 AM
#4
Or use the Sleep API to pause between the characters, and each time simply draw one more. (That's a C style approach, since it doesn't have such controls as in VB)
All the buzzt
 CornedBee
"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond Chen
Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.
-
Mar 2nd, 2002, 12:16 PM
#5
Good Ol' Platypus
Yeah, I would use Cornedbee's approach if you're not going to have anything else going at the same time.
If you really want to freak him out, try opening, writing a letter to a text file that you make, and closing the file. Do this on a loop basis so the harddrive indicator is going mad.
Something like this I would use:
VB Code:
Function ShowLetters(Delay As Long, Word As String, Output As Label)
Dim I As Long
Dim T As Long
Output.Caption = ""
For I = 1 To Len(Word)
T = GetTickCount
Do
DoEvents
Loop Until GetTickCount - T => Delay
Output.Caption = Output.Caption & Mid(Word, I, 1)
Next I
End Function
Use Delay as a millisecond value and make sure you have the GetTickCount API declared.
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
Mar 2nd, 2002, 07:44 PM
#6
Thread Starter
Member
THANKS!!!!!!!!
Ok, Sastraxi, You always answer my forums with good answers, but your too advanced for me.... I tried the Bees thing and yours but I didn't get anything to work,,,,, how would i pause between each letter? I just used the label thing, that is a lot easier.... and also where would be a good place to learn Direct-X, I am a beginner at it..... VERY VERY BEGINNER.....
THANKS SO MUCH!!!!
-
Mar 2nd, 2002, 08:10 PM
#7
Frenzied Member
-
Mar 2nd, 2002, 10:57 PM
#8
Good Ol' Platypus
Okay, download this sample and see how to use it (it's a form):
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
Mar 2nd, 2002, 11:43 PM
#9
Good Ol' Platypus
And here's one with the subclassing:
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
Mar 4th, 2002, 12:16 AM
#10
Addicted Member
VB Code:
'1 textbox
'1 label
'1 Timer
'1 CommandButton
Private Sub Command1_Click()
Timer1.Interval = 100
Timer1.Enabled = True
End Sub
Private Sub Form_Load()
Timer1.Enabled = False
End Sub
Private Sub Timer1_Timer()
On Error GoTo Timer1_ERR
Static Counter As Integer
If Counter = Len(Text1.Text) + 1 Then
Counter = 0
'Label1.Caption = ""
Timer1.Enabled = False
Exit Sub
End If
Label1.Caption = Left(Text1.Text, Counter)
Counter = Counter + 1
DoEvents
Exit Sub
Timer1_ERR:
Debug.Print Err.Number & ":" & Err.Description
Counter = 0
Timer1.Enabled = False
End Sub
-
Mar 5th, 2002, 06:20 AM
#11
Retired VBF Adm1nistrator
Originally posted by Behemoth
Plenderj and Arbiter argued about this in a thread recently. you should be able to find it if you do a search.
(incidentally they had almost identical code, and I think it was very similar to jamieoboth's)
That discussion was a looong time ago I believe
Microsoft MVP : Visual Developer - Visual Basic [2004-2005]
-
Mar 7th, 2002, 03:52 PM
#12
Hyperactive Member
Re: How would you make 1 letter appear at a time W/O having 50 timers? Thanks- HELP!
Ahh, If you really want to freak him out, you can make the CD-Rom door open and close by itself a couple of times!
Put this in the declarations section:
Private Declare Function mciSendString Lib "winmm.dll" Alias _
"mciSendStringA" (ByVal lpstrCommand As String, ByVal _
lpstrReturnString As String, ByVal uReturnLength As Long, _
ByVal hwndCallback As Long) As Long
To open the CD-Rom door, use this code (returnstring doesn't have to be set to anything):
retvalue = mciSendString("set CDAudio door open", returnstring, 127, 0)
To close to CD-Rom door, use this code:
retvalue = mciSendString("set CDAudio door closed", returnstring, 127, 0)
Sorry if this is off topic, but I think this would be pretty funny!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|