Congratulations to AcaCandy on her 100,000th post!
There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
acer black screen blue screen boot bsod computer connection crash css dell display drive driver drivers email error ethernet excel firefox firefox 3 game hard drive internet internet explorer itunes laptop linux malware monitor network networking nvidia outlook outlook 2003 outlook 2007 outlook express partition problem router slow software sound trojan usb video virus vista windows windows xp wireless
Software Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
I need help with vb


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
nickelodeon's Avatar
Senior Member with 599 posts.
 
Join Date: Nov 2002
Location: australia
15-Nov-2003, 04:17 AM #1
I need help with vb
hay,

ive got visual basics and i was wondering could sum1 plz tell me how to do an animation?

also if a button is clicked how do i make it go to a new window?




thanks
Regicide's Avatar
Senior Member with 302 posts.
 
Join Date: Aug 2003
Experience: Advanced
18-Nov-2003, 11:43 AM #2
What kind of animation? Flash, GIF? If you are using flash, you might need to download a new control. If it's a GIF, you could simply use the IE Controller. In order to make a new winodw appear, you must make another form. To make it show, do something like this:
Code:
private sub Command1_Click()
newForm.show
End Sub
-----OR-----

Code:
private sub Command1_Click()
newForm.load
End Sub
If you do the second one, in the load sub of the other form, you MUST have it say: "Me.visible = true". It's been awhile since I've used VB, so this might not work. But, good luck.
__________________
When you give everything and the feeling is gone
All the giving is fake, did you fake enough?
When you take everything and you stay too long
When there's nothing left, did you take enough?
nickelodeon's Avatar
Senior Member with 599 posts.
 
Join Date: Nov 2002
Location: australia
19-Nov-2003, 03:24 AM #3
thanks and also i just need to know how to program timers.
Mosaic1's Avatar
Distinguished Member with 7,502 posts.
 
Join Date: Aug 2001
19-Nov-2003, 03:31 AM #4
Put a timer on the form. In the properties set its interval and as enabled. 1000 is one second.
In the Timer Event write the code which you want to run.
Here I have the Interval set for 10000
Every 10 seconds the message box will appear.

Private Sub Timer1_Timer()
MsgBox "Timer is set"
End Sub
nickelodeon's Avatar
Senior Member with 599 posts.
 
Join Date: Nov 2002
Location: australia
19-Nov-2003, 08:20 PM #5
well thats how to make a msg box cum up but what i want to do is make a line move with a timer. **ive seen it done b4**
coderitr's Avatar
Distinguished Member with 3,080 posts.
 
Join Date: Oct 2003
19-Nov-2003, 10:01 PM #6
Private Sub Timer1_Timer
Static linepos as Long = 0
Line1.Left = linepos + 1
End Sub
Mosaic1's Avatar
Distinguished Member with 7,502 posts.
 
Join Date: Aug 2001
20-Nov-2003, 05:39 AM #7
A line doesn't have a left property.

It has four points to be considered.

X1 X2 Y1 Y2
A line has a beginning and end point. Left , right, Top Bottom.

Have a look in help for more on this.

Pretty much like this to move a straight line from left to right starting with a vertical line at the left of the control.

In the timer event:

Line1.X1 = Line1.X1 + 10
Line1.X2 = Line1.X2 + 10


Or to go from top to bottom starting with a horizontal line at the top of a control.

Line1.Y1 = Line1.Y1 + 10
Line1.Y2 = Line1.Y2 + 10


Neither of these is coded to stop or return. This is just a quick example.

Last edited by Mosaic1 : 20-Nov-2003 05:52 AM.
coderitr's Avatar
Distinguished Member with 3,080 posts.
 
Join Date: Oct 2003
20-Nov-2003, 06:45 PM #8
You're absolutely right. Sorry.
nickelodeon's Avatar
Senior Member with 599 posts.
 
Join Date: Nov 2002
Location: australia
22-Nov-2003, 10:40 PM #9
hi,

thanks for that it worked great. What i would like to know now is how do i make the line move when a command button is clicked?

thanks
Mosaic1's Avatar
Distinguished Member with 7,502 posts.
 
Join Date: Aug 2001
22-Nov-2003, 11:42 PM #10
You're welcome.

You would do that by enabling the timer.
To stop it, disable the timer.

timer1.enabled = true

or timer1.enabled = false
nickelodeon's Avatar
Senior Member with 599 posts.
 
Join Date: Nov 2002
Location: australia
23-Nov-2003, 03:19 AM #11
lol I have another thing to find out


There are afew more things i need to know to finish off my project.

1. How do i make a line stop moving?

2. I have made a person with lines in vb and what i want to do is at one stage when the persons arms are down, when u click a buttin i want them up.


thanks
__________________
If you have a complaint about what I have just posted please write it LEGIBLY inside this box []



SPECS
Pentium 4 3.01 ghz
512mB DDR Ram
256 MB FX5700
ADSL 512k
80 Gig
DVD-RW LITE-ON
Mosaic1's Avatar
Distinguished Member with 7,502 posts.
 
Join Date: Aug 2001
23-Nov-2003, 01:24 PM #12
I answered. Use the timer. Disable or enable the timer. I take it you have the various lines on timers.
nickelodeon's Avatar
Senior Member with 599 posts.
 
Join Date: Nov 2002
Location: australia
24-Nov-2003, 03:49 AM #13
no thats not what i mean.

when i click the button that enables the timer the line doesnt stop moving. I want the line to come to a stop b4 the end of the screen.
Mosaic1's Avatar
Distinguished Member with 7,502 posts.
 
Join Date: Aug 2001
24-Nov-2003, 08:31 PM #14
Have you tried to figure it out? If this is a school assignment you should make an effort. Next time please post some code.

Vertical line at left of form moving to the right...... This will make it start over from the left again once it reaches the form's right side. If you just want it to stop, add an Exit Sub before the End if

Code:
Private Sub Timer1_Timer()

If Line1.X1 = Form1.Width Then
MsgBox "Ouch, that really hurt!"
MsgBox Line1.X1 & " " & Form1.Width
Line1.X1 = 0
Line1.X2 = 0
End If

Line1.X1 = Line1.X1 + 10
Line1.X2 = Line1.X2 + 10

End Sub
Closed Thread

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who help people like you solve computer problems. See our Welcome Guide to get started.



Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 04:19 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.