Results 1 to 17 of 17

Thread: label with timer

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2009
    Location
    vbforums
    Posts
    809

    label with timer

    how to use label to stay some time on form and unload itself

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

    Re: label with timer

    Have you tried Seenu's code here?
    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

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2009
    Location
    vbforums
    Posts
    809

    Re: label with timer

    Quote Originally Posted by Nightwalker83 View Post
    Have you tried Seenu's code here?
    i don't think what i mean is that what senu has shown

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

    Re: label with timer

    Using the code you used to solve the problem in the above thread.

    vb Code:
    1. Option Explicit
    2. Dim cnt As Integer
    3. Private Sub Form_Load()
    4. Label2.Visible = False
    5. Picture2.Height = Picture1.Height
    6. Picture2.BackColor = vbBlue
    7. Picture2.Width = 0
    8. tm.Enabled = True
    9. tm.Interval = 1
    10. End Sub
    11.  
    12. Private Sub tm_Timer()
    13. cnt = cnt + 1
    14. Label1.Caption = (cnt) & "      %  "
    15. If cnt > 100 Then
    16. Label2.Visible = True
    17. tm.Enabled = False
    18. Else
    19. Picture2.Width = (cnt / 100) * Picture1.Width
    20. End If
    21. End Sub
    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

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2009
    Location
    vbforums
    Posts
    809

    Re: label with timer

    you are wright ..Nightwalker83 .. but i want the label should be display only once when ist time form is load .. and when in next time of form loading label should be loaded

    at ist instance of form load label is displayed and unloaded
    and in 2nd instance of form load label should not be displayed,,

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

    Re: label with timer

    Not sure if this is what you want?

    vb Code:
    1. Option Explicit
    2.     Dim cnt As Integer
    3.  
    4. Private Sub Command1_Click()
    5.  
    6. Unload Me
    7. Form2.Show
    8. End Sub
    9.  
    10. Private Sub Form_Initialize()
    11.     tm.Enabled = True
    12.     tm.Interval = 1
    13. End Sub
    14.  
    15. Private Sub Form_Load()
    16. Label2.Visible = False
    17.     Picture2.Height = Picture1.Height
    18.     Picture2.BackColor = vbBlue
    19.     Picture2.Width = 0
    20. End Sub
    21.  
    22.     Private Sub tm_Timer()
    23.     cnt = cnt + 1
    24.     Label1.Caption = (cnt) & "      %  "
    25.     If cnt > 100 Then
    26.     Label2.Visible = True
    27.     tm.Enabled = False
    28.     cnt = 0
    29.     Else
    30.     Picture2.Width = (cnt / 100) * Picture1.Width
    31.     End If
    32.     End Sub
    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

  7. #7

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2009
    Location
    vbforums
    Posts
    809

    Re: label with timer

    Quote Originally Posted by Nightwalker83 View Post
    Not sure if this is what you want?

    vb Code:
    1. Option Explicit
    2.     Dim cnt As Integer
    3.  
    4. Private Sub Command1_Click()
    5.  
    6. Unload Me
    7. Form2.Show
    8. End Sub
    9.  
    10. Private Sub Form_Initialize()
    11.     tm.Enabled = True
    12.     tm.Interval = 1
    13. End Sub
    14.  
    15. Private Sub Form_Load()
    16. Label2.Visible = False
    17.     Picture2.Height = Picture1.Height
    18.     Picture2.BackColor = vbBlue
    19.     Picture2.Width = 0
    20. End Sub
    21.  
    22.     Private Sub tm_Timer()
    23.     cnt = cnt + 1
    24.     Label1.Caption = (cnt) & "      %  "
    25.     If cnt > 100 Then
    26.     Label2.Visible = True
    27.     tm.Enabled = False
    28.     cnt = 0
    29.     Else
    30.     Picture2.Width = (cnt / 100) * Picture1.Width
    31.     End If
    32.     End Sub
    thanks but i do not want to put any count system in label .. it is simple label which only should load when form is loaded and unload after few seconds .. and when in 2nd instance again form is loaded the label should not be loaded.. something like SaveSetting and GetSetting

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

    Re: label with timer

    Modify the code I have given you to make it work with the code weeluke gave you here.
    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

  9. #9

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2009
    Location
    vbforums
    Posts
    809

    Re: label with timer

    Quote Originally Posted by Nightwalker83 View Post
    Modify the code I have given you to make it work with the code weeluke gave you here.
    that was about startup form .. it is about label on startup form

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

    Re: label with timer

    Yes, but that code weeluke gave you can be modified to do what you want.
    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

  11. #11
    Just a Member! seenu_1st's Avatar
    Join Date
    Aug 2007
    Location
    India
    Posts
    2,170

    Re: label with timer

    @Janu, can u attach the project herewith with some clear info abt the requirement?
    Seenu

    If this post is useful, pls don't forget to Rate this post.
    Pls mark thread as resolved once ur problem solved.
    ADO Tutorial Variable types SP6 for VB6, MsFlexGrid fast fill, Sorting Algorithms


  12. #12

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2009
    Location
    vbforums
    Posts
    809

    Re: label with timer

    Quote Originally Posted by seenu_1st View Post
    @Janu, can u attach the project herewith with some clear info abt the requirement?
    the label on form1 should do the job .. as you have done productupdate form
    Attached Files Attached Files

  13. #13

    Thread Starter
    Fanatic Member
    Join Date
    Mar 2009
    Location
    vbforums
    Posts
    809

    Re: label with timer

    sorry ! sample is here
    Attached Files Attached Files

  14. #14
    PowerPoster
    Join Date
    Aug 2011
    Location
    B.C., Canada
    Posts
    2,887

    Re: label with timer

    i did not fully understand your request very good but this is what i thought might help
    Attached Files Attached Files

  15. #15
    Just a Member! seenu_1st's Avatar
    Join Date
    Aug 2007
    Location
    India
    Posts
    2,170

    Re: label with timer

    @janu, try this
    Code:
    Private Sub Form_Load()
    Form1.Show
    Label1.Visible = False
    
    On Error Resume Next
    SaveSetting "hh", "StartupForm", "TimesRun", GetSetting("hh", "StartupForm", "TimesRun", 0) + 1
    Timesrun = GetSetting("hh", "StartupForm", "TimesRun")
    ProUpdate = GetSetting("hh", "StartupForm", "ProductUpdate")
    
    If ProUpdate <> "Loaded" Then
        productupdate.Show vbModal
        Label1.Visible = True
    End If
    
    If booCheck = False Then
    popup.Label1.Caption = "You have used this Programme - " & Timesrun & " Times"
    popup.Show
    booCheck = True
    Else
        'dont do anything
    End If
    
    End Sub
    Seenu

    If this post is useful, pls don't forget to Rate this post.
    Pls mark thread as resolved once ur problem solved.
    ADO Tutorial Variable types SP6 for VB6, MsFlexGrid fast fill, Sorting Algorithms


  16. #16
    PowerPoster
    Join Date
    Aug 2011
    Location
    B.C., Canada
    Posts
    2,887

    Re: label with timer

    here is what else you could be asking
    Attached Files Attached Files

  17. #17
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: label with timer

    Sorry, but I don't get what your question. Janu, could you please explain a bit more about what you are trying to accomplish ?


    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

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