Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Toolbars and status bars in dialog based apllication

Status
Not open for further replies.

Naits

Programmer
Oct 10, 2001
90
NO
Is there a way to get a toolbar and/or a status bar in a mfc dialog based application? __________________
Visit my homepage
.: Game universE :.
 
Yes,

and here is how :

1 - create a tool bar in resources

2 - in your dialog header file add :
protected:
CToolBar cToolBar;
3 - in your dialog source file in the OnInitDialog add :
//add the tool bar to the dialog
cToolBar.Create(this);
cToolBar.LoadToolBar(IDR_TOOLBAR1);
cToolBar.ShowWindow(SW_SHOW);
cToolBar.SetBarStyle(CBRS_ALIGN_TOP | CBRS_TOOLTIPS | CBRS_FLYBY
| CBRS_BORDER_TOP |CBRS_BORDER_BOTTOM|CBRS_GRIPPER);

//Called to reposition and resize control bars in the client
//area of a window
RepositionBars(AFX_IDW_CONTROLBAR_FIRST, AFX_IDW_CONTROLBAR_LAST, 0);

if you want to allow tooltip text on your toolbar let's tell me, there some code to add.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top