CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Timer as object

  1. #1
    Join Date
    Oct 1999
    Location
    Sweden
    Posts
    33

    Timer as object

    Hi!
    I would like to have a timer as an object. But I guess that since it is an activeX control I can´t create it??

    This is what I had in mind:
    Dim tim As Timer
    Set tim = CreateObject("VB.Timer")

    My project is a activeXdll. I want a timer to run somehow. How can I achive that?

    Jen



  2. #2
    Join Date
    May 1999
    Posts
    3,332

    Re: Timer as object

    this a sample for using a Timer:

    Dim x as Variant
    x = Timer
    MsgBox x
    Dim y as Variant
    y = Timer
    MsgBox y - x



    it is used for calculating the elapsed time between two code sections.

    I gues what YOU need is a timer control.
    You can place such an object on a (hidden) form and trap the "Timer" event.

    You could also use the SetTimer API call.


  3. #3
    Join Date
    Oct 1999
    Location
    India
    Posts
    5

    Re: Timer as object

    try this out !!

    add a form Form1 to the project (although you dont need to show it)
    add a timer control to the form

    then you can create :
    dim t as new form1.timer1




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured