SOLVED:How can i put current oclock in statusbar |
Post Reply |
Author | |
unforgiven
Groupie Joined: 24 February 2010 Location: Neverland Status: Offline Points: 35 |
Post Options
Thanks(0)
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 |
|
younicke
Senior Member Joined: 11 March 2005 Status: Offline Points: 107 |
Post Options
Thanks(0)
|
just use the update event of the commandbars and change the caption of the statusbar pane with the current time
|
|
unforgiven
Groupie Joined: 24 February 2010 Location: Neverland Status: Offline Points: 35 |
Post Options
Thanks(0)
|
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 |
|
Oleg
Admin Group Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
|
Hi,
Don't add new pane on each run - Find pane you added before and update its text.
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
younicke
Senior Member Joined: 11 March 2005 Status: Offline Points: 107 |
Post Options
Thanks(0)
|
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 |
|
cmm2006
Senior Member Joined: 26 September 2006 Status: Offline Points: 118 |
Post Options
Thanks(0)
|
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 |
|
unforgiven
Groupie Joined: 24 February 2010 Location: Neverland Status: Offline Points: 35 |
Post Options
Thanks(0)
|
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 |
|
younicke
Senior Member Joined: 11 March 2005 Status: Offline Points: 107 |
Post Options
Thanks(0)
|
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 |
|
unforgiven
Groupie Joined: 24 February 2010 Location: Neverland Status: Offline Points: 35 |
Post Options
Thanks(0)
|
Dear Younicke
your code is Ok and work fine. I appreciate for your reply |
|
younicke
Senior Member Joined: 11 March 2005 Status: Offline Points: 107 |
Post Options
Thanks(0)
|
you're welcome
|
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |