4 Replies - 4930 Views - Last Post: 10 March 2008 - 11:28 PM Rate Topic: -----

#1 babycollie  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 09-March 08

The image control using timer

Posted 09 March 2008 - 03:16 AM

hello there!! please help me for my homework :blink: ..am not really expert in doing visual basic...my program is something like a traffic light, but i change it like an image control using my picture..my problem is, i want to set a timer in every picture..what am going to do? :rolleyes: and i also want to put an Exit button and stop button,what are the codes that am trying to Use? :rolleyes: :wacko: please help me to enhance my program..i need only simple codes so that it's not hard for me to defend my program...please help me...tnx! and more power!! :bananaman:

here's my code:

Option Explicit
Private mstrPicture as String
Private Sub Form_Load() 
mstrPicture="G"
imgMyPic.Picture=imgMyPicOne.Picture
End Sub
Private Sub tmrChangeMyPic_Timer()
If mstrPicture="G" then
imgMyPic.Picture=imgMyPicTwo.Picture
mstrPicture="Y"
ElseIf mstrPicture="Y" then
imgMyPic.Picture=imgMyPicThree.Picture
mstrPicture="R"
Else
imgMyPic.Picture=imgMyPicOne.Picture
mstrPicture="G"
End If
End Sub




:)

This post has been edited by PsychoCoder: 09 March 2008 - 06:03 AM


Is This A Good Question/Topic? 0
  • +

Replies To: The image control using timer

#2 Zub  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 33
  • Joined: 07-March 08

Re: The image control using timer

Posted 09 March 2008 - 03:24 PM

Hello babycollie

What exactly are you doing?
Sorry but i am not sure how to define your question
But let me see if i can guess what is going on in here.

are you trying to add few pictures in a Form and then
play this group of images sequently so they can run
over and over one after another?
Was This Post Helpful? 0
  • +
  • -

#3 babycollie  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 09-March 08

Re: The image control using timer

Posted 10 March 2008 - 08:09 AM

yup!! i want to add more Picture .. and i want to add also a stop button so that if i press stop, it will automatically stop.. but the problem is, i don't know the exact codes...please help me...
Was This Post Helpful? 0
  • +
  • -

#4 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1641
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: The image control using timer

Posted 10 March 2008 - 08:16 AM

I see you're already using a timer control, but you're not setting any of its properties to make it work. DeveloperFusion has a nice article on using a timer control in your Visual Basic 6 application. Read that article, try some of the examples he shows, then if you run into trouble post the code you're having an issue with, in code tags like :code: , and we will be more than happy to help as much as we can :)
Was This Post Helpful? 0
  • +
  • -

#5 Zub  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 33
  • Joined: 07-March 08

Re: The image control using timer

Posted 10 March 2008 - 11:28 PM

Hello again babycollie

i remember the first time i wanted to do this so badly :-)
i remember looking for help everywhere and never find any.

then i did something out of no where just to see it in action :-)
i know this is not the way to play with this, but this is an exact
example on how i done it my way :-)

start a project and add a timer to it, then add 2 shapes to the form
set the timer to 10 or just test it first and see how fast it goes :-)

you know what, download this example i just made to remember that moment
this is not going to help you in any way, but just take a look and see it
is a novice example so don't make fun of me, OK?

Download example from here

Now i know a better way to this :-), but for now i'll let you play with this.

So good luck with your project.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1