Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - SOLVED:How can i put current oclock in statusbar
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

SOLVED:How can i put current oclock in statusbar

 Post Reply Post Reply
Author
Message
unforgiven View Drop Down
Groupie
Groupie
Avatar

Joined: 24 February 2010
Location: Neverland
Status: Offline
Points: 35
Post Options Post Options   Thanks (0) Thanks(0)   Quote unforgiven Quote  Post ReplyReply Direct Link To This Post Topic: SOLVED:How can i put current oclock in statusbar
    Posted: 10 March 2010 at 10:00am
I want to put current time in statusbar,but i can't how can i do that?
is there any way to put time in statusbar .
current time show in control timer.
I don't know how can i use of timer control to combine statusbar
thaks all
Back to Top
younicke View Drop Down
Senior Member
Senior Member
Avatar

Joined: 11 March 2005
Status: Offline
Points: 107
Post Options Post Options   Thanks (0) Thanks(0)   Quote younicke Quote  Post ReplyReply Direct Link To This Post Posted: 10 March 2010 at 6:36pm
just use the update event of the commandbars and change the caption of the statusbar pane with the current time
Back to Top
unforgiven View Drop Down
Groupie
Groupie
Avatar

Joined: 24 February 2010
Location: Neverland
Status: Offline
Points: 35
Post Options Post Options   Thanks (0) Thanks(0)   Quote unforgiven Quote  Post ReplyReply Direct Link To This Post Posted: 11 March 2010 at 3:15am
Hi younick
as you told i use update event but i face to error:

Private Sub CommandBars_Update(ByVal Control As XtremeCommandBars.ICommandBarControl)
Dim StatusBar As IStatusBar
Dim Pane As StatusBarPane
Set Pane = StatusBar.AddPane(ID_TIME_PANE)
Pane.Text = Time$
End Sub
----------------
to show current time i use timer control

Private Sub timehoure_Timer()
On Error Resume Next
If Label2.Caption <> CStr(Time) Then
Label2.Caption = Time$
End If
End Sub

pls put right code or trim my code
thanks
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 11 March 2010 at 7:59am
Hi,
Don't add new pane on each run - Find pane you added before and update its text.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
younicke View Drop Down
Senior Member
Senior Member
Avatar

Joined: 11 March 2005
Status: Offline
Points: 107
Post Options Post Options   Thanks (0) Thanks(0)   Quote younicke Quote  Post ReplyReply Direct Link To This Post Posted: 11 March 2010 at 8:26am
no more timer control needed.. just the update event of the commandbars.

define the statusbar panes in the form load event
and in the updateevent of the commandbars search
for the pane that you want to show the current time
and then replace the text with the current time
Back to Top
cmm2006 View Drop Down
Senior Member
Senior Member


Joined: 26 September 2006
Status: Offline
Points: 118
Post Options Post Options   Thanks (0) Thanks(0)   Quote cmm2006 Quote  Post ReplyReply Direct Link To This Post Posted: 11 March 2010 at 12:49pm

I know that you can use the following codes to add (CAPS, NUM,...):

    StatusBar.AddPane ID_INDICATOR_CAPS
    StatusBar.AddPane ID_INDICATOR_NUM
    StatusBar.AddPane ID_INDICATOR_SCRL
 
is there any way that we can add time or date (ID_INDACATOR_TIME, ID_INDICATOR_DATE) ?
Thank you
Language: Visual Basic 6 SP6
OS: Windows XP Pro SP3
Product: Codejock Xtreme SuitePro 13.1
Back to Top
unforgiven View Drop Down
Groupie
Groupie
Avatar

Joined: 24 February 2010
Location: Neverland
Status: Offline
Points: 35
Post Options Post Options   Thanks (0) Thanks(0)   Quote unforgiven Quote  Post ReplyReply Direct Link To This Post Posted: 11 March 2010 at 1:43pm
for showing date i use this code on form_load event:

Dim StatusBar As IStatusBar
    Set StatusBar = CommandBars.StatusBar
    
    StatusBar.Visible = True
    Dim Pane As StatusBarPane
      
    Set Pane = StatusBar.AddPane(ID_DATE_PANE)
    Pane.Visible = True
    Pane.Text = " Today : " & Date
    Pane.Width = 0

it's work fine,but for showing current time, i got error
--------------------------------------------------------
with this code i can show time in statusbar,but time is fixed and not change second of it,what's the problem?

Private Sub CommandBars_Update(ByVal Control As XtremeCommandBars.ICommandBarControl)
Select Case Control.Id
Case ID_TIME_PANE
CommandBars.StatusBar.FindPane(ID_TIME_PANE).Text = Time$
End Select

please put code or trim my code to solve this problem
thanks
Back to Top
younicke View Drop Down
Senior Member
Senior Member
Avatar

Joined: 11 March 2005
Status: Offline
Points: 107
Post Options Post Options   Thanks (0) Thanks(0)   Quote younicke Quote  Post ReplyReply Direct Link To This Post Posted: 11 March 2010 at 5:54pm
Private Sub Form_Load()
    ....

    Dim Pane As StatusBarPane

    Set Pane = CommandBars.StatusBar.AddPane(ID_INDICATOR_TIME)
    Pane.Alignment = xtpAlignmentCenter
    Pane.Text = DateTime.Time
    Pane.Width = 0

    ....
End Sub

Private Sub CommandBars_Update(ByVal Control As XtremeCommandBars.ICommandBarControl)
    Set Pane = CommandBars.StatusBar.FindPane(ID_INDICATOR_TIME)
    Pane.Text = DateTime.Time
End Sub

Back to Top
unforgiven View Drop Down
Groupie
Groupie
Avatar

Joined: 24 February 2010
Location: Neverland
Status: Offline
Points: 35
Post Options Post Options   Thanks (0) Thanks(0)   Quote unforgiven Quote  Post ReplyReply Direct Link To This Post Posted: 12 March 2010 at 3:07am
Dear Younicke
your code is Ok and work fine.
I appreciate for your reply
Back to Top
younicke View Drop Down
Senior Member
Senior Member
Avatar

Joined: 11 March 2005
Status: Offline
Points: 107
Post Options Post Options   Thanks (0) Thanks(0)   Quote younicke Quote  Post ReplyReply Direct Link To This Post Posted: 12 March 2010 at 5:37am
you're welcome
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.188 seconds.