-
November 11th, 2011, 09:41 AM
#1
Hide/remove tool bar
Hi guys,
Is there some way of removing the toolbar from your program after you've created it?
I added it when creating the software long ago but now I'd like to do without it.
Simply deleting it doesn't seem to be possible.
I've also tried editting the resource file, but after that the sofware won't compile any longer.
Just to be clear, I'm talking about this toolbar; the one with the icons:
http://i.msdn.microsoft.com/dynimg/IC142616.gif
Thanks!
-
November 11th, 2011, 09:56 AM
#2
Re: Hide/remove tool bar
Originally Posted by rmirani
...
I've also tried editting the resource file, but after that the sofware won't compile any longer.
how did you "delete" it? And where from?
Victor Nijegorodov
-
November 11th, 2011, 10:10 AM
#3
Re: Hide/remove tool bar
From the .rc file, where it says:
/////////////////////////////////////////////////////////////////////////////
//
// Toolbar
//
IDR_MAINFRAME TOOLBAR DISCARDABLE 18, 17
BEGIN
BUTTON ID_FILE_NEW
BUTTON ID_FILE_OPEN
BUTTON ID_FILE_SAVE
END
Deleting that results in errors.
-
November 11th, 2011, 01:09 PM
#4
Re: Hide/remove tool bar
Ah, never mind.
Found it!
Sorry for the trouble.
Whether to draw the toolbar or not can be set in CMainFrame, which contains the toolbar.
It needs to be set in CMainFrame::OnCreate
Code:
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
.....; // leaving out the standard stuff here
.....;
.....;
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndToolBar);
BOOL SHOWTOOLBAR=FALSE;
ShowControlBar(&m_wndToolBar, SHOWTOOLBAR, FALSE);
return 0;
}
Thanks for the help!
Last edited by rmirani; November 11th, 2011 at 01:12 PM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|