I have a form with a toolbar at the top. Since there is ample space to the right side I would like to place a clock control (a label that shows the time) in that area.
Two scenarios come to my mind:
- Limit the width of the toolbar.
- Position a label on top of the toolbar.
Would something like that be possible?
Better make room for it between two separators, then create the label and make it children of the toolbar using the API function SetParent.
Thanks Jose!
But where in FF3 would I find the HWnd for the toolbar?
Depends on whether the toolbar is a child of a rebar or if it is just a standalone toolbar.
If part of a rebar......
Local hRebar As Dword
Local hToolBar As Dword
hRebar = GetDlgItem( hWndForm, IDC_FRMMAIN_REBAR )
hToolBar = GetDlgItem( hRebar, IDC_FRMMAIN_TOOLBAR1 )
If standalone......
Local hToolBar As Dword
hToolBar = GetDlgItem( hWndForm, IDC_FRMMAIN_TOOLBAR1 )
(Substitute your IDC_'s depending on the name you have given your form/rebar/toolbar)
Great! Thanks for the quick help, Paul.
... and it works perfect!
What I did notice though is that the control changes its ForeColor and Backcolor. Is it possible to change that? Or does the toolbar set that?