|
-
Oct 22nd, 2002, 03:58 PM
#1
Thread Starter
New Member
After a control is loaded at runtime...
OK, I've looped through a text file and loaded a timer control with names of which are in the text file, works fine. But after the control is loaded, I want it to increase a variable by 1. How would I do this? Or is it possible? Thanks!
-
Oct 22nd, 2002, 04:02 PM
#2
Hyperactive Member
-
Oct 22nd, 2002, 04:04 PM
#3
Thread Starter
New Member
Originally posted by Ken Whiteman
Variable = Variable + 1
I know that.
But, I want to make the timer I loaded at runtime increase the variable by 1......possible? Or am I just over looking something?
-
Oct 22nd, 2002, 04:10 PM
#4
Hyperactive Member
If you have loaded a timer at runtime, then it should have an index of 0.
Use the Timer event under that index to do the job.
Timer1_Timer(Index as Integer)
if index = 1 then
Variable = Variable + 1
end if
-
Oct 22nd, 2002, 04:48 PM
#5
Thread Starter
New Member
Originally posted by Ken Whiteman
If you have loaded a timer at runtime, then it should have an index of 0.
Use the Timer event under that index to do the job.
Timer1_Timer(Index as Integer)
if index = 1 then
Variable = Variable + 1
end if
I'm sorry. I do not understand...
I'm making a MUD(text game) and I want a timer with the name I just created here:
Code:
Sub AddTimers(FileName As String)
Dim lstInput As String
On Error Resume Next
Open FileName$ For Input As #1
While Not EOF(1)
Input #1, lstInput$
'DoEvents
Set Control = Controls.Add("VB.timer", ReplaceText(lstInput$, " ", "") + "HP")
With Control
.Enabled = True
.Interval = 1000
End With
Wend
Close #1
End Sub
'<---Add the timers at run time with names in users.txt--->
Private Sub Form_Load()
FormOnTop Me.hwnd, True
Call AddTimers("C:\Rag\users.txt")
End Sub
...to raise a variable (HP, or Life) 1 per second.
Maybe I'm not very clear? Sorry my english is bad...
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
|