Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

graphic timing question

Status
Not open for further replies.

mikej336

MIS
Feb 10, 2005
164
0
0
US
I am new to .net. Just trying to make a line move across the screen. What is the best way to pause between moving the line segement. In the old days we just used a loop and counted to a large number. Like....

Dim x1, x2 As Integer
Dim chg As Integer ' amount of change

Dim c As Long 'counter

chg = 2

x1 = 1
x2 = 2


c = 1

Do While x2 < 400
e.Graphics.DrawLine(Pens.Black, x1, 25, x2, 25)
e.Graphics.DrawLine(Pens.LightGray, x1 - chg, 25, x2 - chg, 25)
x1 = x1 + chg
x2 = x2 + chg
Do While c < 10000000
c = c + 1
Loop
c = 1
Loop

I figure there has to be a newer method...

Thanks

Uncle Mike
 
You could use a timer.

I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson

Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day! Ye has a choice: talk like a pira
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top