Print Page | Close Window

Help with time in a statusbar

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=23356
Printed Date: 27 November 2024 at 2:07am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Help with time in a statusbar
Posted By: jordenes
Subject: Help with time in a statusbar
Date Posted: 02 June 2017 at 12:34pm
Hello and good I am new with these OCX but I have a problem when I want to create a statusbars with the hour and that this is updated every 1 minute or better that is updated to the actuactual hroa, if you can help me I would be very grateful



Replies:
Posted By: rmcmanamy
Date Posted: 28 June 2017 at 10:03am
This post might help you out.

http://forum.codejock.com/forum_posts.asp?TID=16405&KW=statusbar+time&title=solvedhow-can-i-put-current-oclock-in-statusbar


-------------
Product: Xtreme SuitePro (ActiveX Unicode) version 22.0.0

Platform: Windows 11 (64bit)

Language: Visual Basic 6.0



Posted By: gibra
Date Posted: 28 June 2017 at 3:29pm
In main form :

1) declare: Const ID_INDICATOR_TIME = 10000

2) in Form_Load event  create a StatusBarPane object:

    Dim Pane As StatusBarPane
    Set Pane = StatusBar.AddPane(ID_INDICATOR_TIME)
    Pane.Width = 50
    Pane.Visible = True
    Pane.BeginGroup = True
    Pane.Style = SBPS_NOBORDERS
    Pane.Text = Format$(Time, "HH:SS")


3) a Timer i.e. Timer1 and set the Interval = 10000

In Timer1_Timer() event:

    Private Sub Timer1_Timer()
        Dim TimePane As StatusBarPane
        Set TimePane = StatusBar.FindPane(ID_INDICATOR_TIME)
        TimePane.Text = Format$(Time, "HH:SS")
    End Sub


Run the project.



-------------
gibra
CJ SuiteControl v: 13.x to 19.x
Windows 10 64bit
VS2019 - VB6.0 SP6
<a href="http://nuke.vbcorner.net/Home/tabid/36/language/en-US/Default.aspx" rel="nofollow">VS/VB 6.0 Installer v6.8



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net