hi guys,
im a complete noob.
basically im creating a program where i want a series of circles to appear on the screen each with a varied amount of delay.....so for example the first circle could appear after 1 second the second after .5 seconds and the third after 1.5 seconds
code<
Dim num As Integer
Private Sub cmdEnd_Click()
End
End Sub
Private Sub cmdStart_Click()
Dim x1 As Integer, x2 As Integer, y1 As Integer, y2 As Integer
Dim c1 As Integer, c2 As Integer, c3 As Integer, r As Integer
picOutput.Cls
Timer1.Interval = Int(Rnd * 2000)
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
num = num + 1
x1 = Int(Rnd * 140)
y1 = Int(Rnd * 140)
r = 10
c1 = Int(Rnd * 255)
c2 = Int(Rnd * 255)
c3 = Int(Rnd * 255)
picOutput.Scale (-100, 200)-(200, -100)
picOutput.FillStyle = 0
picOutput.PSet (x1, y1), RGB(c1, c2, c3)
picOutput.Circle (x1, y1), r, RGB(c1, c2, c3)
Timer1.Enabled = False
End Sub
code>
1 1850
hi guys,
im a complete noob.
basically im creating a program where i want a series of circles to appear on the screen each with a varied amount of delay.....so for example the first circle could appear after 1 second the second after .5 seconds and the third after 1.5 seconds
code<
Dim num As Integer
Private Sub cmdEnd_Click()
End
End Sub
Private Sub cmdStart_Click()
Dim x1 As Integer, x2 As Integer, y1 As Integer, y2 As Integer
Dim c1 As Integer, c2 As Integer, c3 As Integer, r As Integer
picOutput.Cls
Timer1.Interval = Int(Rnd * 2000)
Timer1.Enabled = True
End Sub
Private Sub Timer1_Timer()
num = num + 1
x1 = Int(Rnd * 140)
y1 = Int(Rnd * 140)
r = 10
c1 = Int(Rnd * 255)
c2 = Int(Rnd * 255)
c3 = Int(Rnd * 255)
picOutput.Scale (-100, 200)-(200, -100)
picOutput.FillStyle = 0
picOutput.PSet (x1, y1), RGB(c1, c2, c3)
picOutput.Circle (x1, y1), r, RGB(c1, c2, c3)
Timer1.Enabled = False
End Sub
code>
this way you need to press the cmdStart button every time while you have timer disabled after drawing.
you may also include a new timer interval instead of timer1.enabled=false., where the program continues drawing circles.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: RitaG |
last post by:
Hi.
I Have a VB.Net Windows Application that starts up using Sub Main.
It's a program that runs in the background and checks something every minute.
I use a Timer to accomplish this and it's...
|
by: Daniel P. |
last post by:
I'm trying to set a timer that gets called every 3 seconds so I can update a
field in the UI with the time elapsed since the process started.
What am I doing wrong that timerDF_Tick does not get...
|
by: avivgur |
last post by:
Hello,
I have devised a console application that uses a System.Timers.Timer
and its Elapsed event.
The problem is that I want the program to continue to run so that each
time the event is raised,...
|
by: Kenny |
last post by:
I am running a windows service that takes actions based on a couple
System.Threading.Timers. The intervals are usually short... based on
the time of day, anywhere between 1 and 5 minutes. ...
|
by: hazz |
last post by:
given
namespace WindowsService1
{
public class Service1 : System.ServiceProcess.ServiceBase.........
private void timer1_Elapsed(object sender, System.Timers.ElapsedEventArgs e)
{
ArrayList...
|
by: Crirus |
last post by:
This is more a logical problem than a VB.
I have this situation:
A timer that need to tick at each 10 minutes starting on minute 15 of curent
hour.
But I want to calculate the next tick...
|
by: Aart Nicolai |
last post by:
Hi all,
I have developed a vb.net console application which will run some code
every seconds. To get this working I used a timer "System.Timers".
When I start my console application it exits...
|
by: Lemune |
last post by:
Hello everyone.
I'm using vb 2005. I'm creating program that run as service on windows.
And in my program I need to use timer, so I'm using timer object from
component. I try my source code on...
|
by: grayaii |
last post by:
Hi,
I have a simple form that handles all its paint functionality like so:
this.SetStyle(ControlStyles.AllPaintingInWmPaint |
ControlStyles.Opaque, true);
And the entry point to this...
|
by: John O'Flaherty |
last post by:
Hello,
I'm having trouble with the timer control in VB6. I have a form with
a timer control and a command button, and this simple code:
Dim TimeOut As Boolean
Private Sub Form_Load()...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |