vsulu
asked on
HOW TO IMPLEMENT TOOLBAR AND STATUS BAR IN DIALOG BASED APPLICATION
I would like to attach a tool bar,status bar in my project
how to do that.i know that in SDI the frame class provides that but
in DIALOG BASED APPLICATION how would i do that.
how to do that.i know that in SDI the frame class provides that but
in DIALOG BASED APPLICATION how would i do that.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If You like to use ReBar's and self made status bar I can post You code (post Your email).
create your own CToolBar derive class and add this code to OnInitDialog():
//IDR_MY_TOOLBAR-> your resource toolbar ID
//u associate your toolbar with the resource ID
cMyToolBar.Create(this);
cMyToolBar.LoadToolBar(IDR _MY_TOOLBA R);
cMyToolBar.ShowWindow(SW_S HOW);
cMyToolBar.SetBarStyle(CBR S_ALIGN_TO P | CBRS_BORDER_TOP | CBRS_TOOLTIPS | CBRS_FLYBY);
RepositionBars(AFX_IDW_CON TROLBAR_FI RST, AFX_IDW_CONTROLBAR_LAST, 0);
in your toolbar class add this function:
LRESULT OnIdleUpdateCmdUI(WPARAM wp, LPARAM lp);
LRESULT CMyToolBar::OnIdleUpdateCm dUI(WPARAM wp, LPARAM lp)
{
if (IsWindowVisible()) {
CFrameWnd* pParent = (CFrameWnd*)GetParent();
if(pParent)
OnUpdateCmdUI(pParent, (BOOL)wp);
}
return 0L;
}
this function is passing the UPDATE_COMMAND_UI to the dialog in order to handle the toolbar's buttons
//IDR_MY_TOOLBAR-> your resource toolbar ID
//u associate your toolbar with the resource ID
cMyToolBar.Create(this);
cMyToolBar.LoadToolBar(IDR
cMyToolBar.ShowWindow(SW_S
cMyToolBar.SetBarStyle(CBR
RepositionBars(AFX_IDW_CON
in your toolbar class add this function:
LRESULT OnIdleUpdateCmdUI(WPARAM wp, LPARAM lp);
LRESULT CMyToolBar::OnIdleUpdateCm
{
if (IsWindowVisible()) {
CFrameWnd* pParent = (CFrameWnd*)GetParent();
if(pParent)
OnUpdateCmdUI(pParent, (BOOL)wp);
}
return 0L;
}
this function is passing the UPDATE_COMMAND_UI to the dialog in order to handle the toolbar's buttons
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:
Answered by : BeyondWu
Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
Roshan Davis
EE Cleanup Volunteer
I will leave a recommendation in the Cleanup topic area that this question is:
Answered by : BeyondWu
Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
Roshan Davis
EE Cleanup Volunteer