Results 1 to 10 of 10

Thread: timer

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2013
    Posts
    8

    timer

    pls i need a code to display label in animation using a timer from left ' you are welcome' with vb.6

    thanks

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: timer

    Welcome to VBForums

    Thread moved from the 'CodeBank VB6' forum (which is for you to post working code examples, not questions) to the 'VB6 and earlier' forum

  3. #3
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,622

    Re: timer

    Not sure what you want.....(your post is not very specific), but....see this post:

    http://www.vbforums.com/showthread.p...bel-not-moving

  4. #4

    Thread Starter
    New Member
    Join Date
    May 2013
    Posts
    8

    Re: timer

    thanks, the code helped me, that was what i was looking for, but when i run the program it will display and go off, pls i want it to be displaying with out going off.

    Thanks

  5. #5
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,622

    Re: timer

    Did you add the two lines I posted in my last post? It will continue to display.

  6. #6

    Thread Starter
    New Member
    Join Date
    May 2013
    Posts
    8

    Re: timer

    yes i added it u can view it ur self

    Private Sub tmrTest_Timer()
    If tmrTest.Interval = 100 Then
    lblCaption.Move lblCaption.Left - 100
    If lblCaption.Left + lblCaption.Width < 0 Then
    lblCaption.Left = Me.Width
    End If
    End Sub

    are mine suppose to add anything at the labelCaption_Click()

    thanks

  7. #7
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,622

    Re: timer

    Your code is not correct. This is a sample code that is: EDIT: Not MY Code...just some modified from the other post!

    Code:
    Option Explicit
    
    Private Sub Command1_Click()
    
    
    label1.Caption = "Hello World. Example of a Marquee."
    label1.Alignment = vbRightJustify
    Me.Font = label1.Font
    label1.Width = Me.TextWidth(label1.Caption) + 3
    Timer1.Interval = 100
    Timer1.Enabled = True
    End Sub
    
    Private Sub Form_Load()
    Timer1.Enabled = False
    End Sub
    Private Sub Timer1_Timer()
    
    Static i As Integer
    If Timer1.Interval = 100 Then
    i = i + 1
    label1.Move label1.Left - 100
    i = 1
    If label1.Left + label1.Width < 0 Then
    label1.Left = Me.Width
    End If
    End If
    End Sub
    Add a label. Add a timer. Add a commandbutton. and run the project. You should be able to figure this out with this code.
    Last edited by SamOscarBrown; May 10th, 2013 at 01:05 PM.

  8. #8
    Banned
    Join Date
    Nov 2012
    Posts
    1,171

    Re: timer

    he wanted a marquee text moving left or right

  9. #9
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,344

    Re: timer

    @ Sam, call it a joint effort!

    @ladoo I though the OP in the other thread wanted the text to move left.
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  10. #10

    Thread Starter
    New Member
    Join Date
    May 2013
    Posts
    8

    Re: timer

    Quote Originally Posted by SamOscarBrown View Post
    Your code is not correct. This is a sample code that is: EDIT: Not MY Code...just some modified from the other post!

    Code:
    Option Explicit
    
    Private Sub Command1_Click()
    
    
    label1.Caption = "Hello World. Example of a Marquee."
    label1.Alignment = vbRightJustify
    Me.Font = label1.Font
    label1.Width = Me.TextWidth(label1.Caption) + 3
    Timer1.Interval = 100
    Timer1.Enabled = True
    End Sub
    
    Private Sub Form_Load()
    Timer1.Enabled = False
    End Sub
    Private Sub Timer1_Timer()
    
    Static i As Integer
    If Timer1.Interval = 100 Then
    i = i + 1
    label1.Move label1.Left - 100
    i = 1
    If label1.Left + label1.Width < 0 Then
    label1.Left = Me.Width
    End If
    End If
    End Sub
    Add a label. Add a timer. Add a commandbutton. and run the project. You should be able to figure this out with this code.
    THANKS

    PLS I AM TRYING TO RIGHT A PROGRAM FOR A HOSPITAL IN WHICH EVERY INFORMATION WILL BE STALL IN A DATABASE, EXAMPLE OF THE TABLE THE NAME OF PATIENTS, FOLDER NO, COMPANY, DIAGNOSIS, DRUGS AND THEIR AMOUNT AND SPECIALIST CONSULTATION. AM TRYING TO DESIGN THE INTERFACE BE I AM CONFUSE NOW, I HAVE DESIGNED THE TABLE ON EXCEL, PLS I NEED UR HELP I AM NEW ON VB. UR LAST CODE HELPED ME I AM GRATEFUL AT-LEAST I HAVE GOTTEN THE WELCOME PAGE OF WHAT I WANT

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