|
-
June 23rd, 1999, 01:24 AM
#1
How to attach a ToolBar to the main parent window
Iam not using MFC AppWizard. I need to know How to attach a ToolBar to the main parent window.Can someone please help me out?
-
June 23rd, 1999, 01:35 AM
#2
Re: How to attach a ToolBar to the main parent window
Try this one (I used a CReBar...) on the CMainFrame::OnCreate:
[if (!m_wndReBar.Create(this))
{
TRACE0("Failed to create rebar\n");
return -1; // fail to create
}
if (!m_wndToolBar1.CreateEx(this) ||
!m_wndToolBar1.LoadToolBar(IDR_STANDARD))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
} ]
where :
[ CToolBar m_wndToolBar6;
CReBar m_wndReBar;]
If you need a special toolbar with some big buttons (like IE), you have a sample in the MSDN, called MSIE. Please let me know if it works or if you still have some problems.
Regards,
Fabi
-
June 23rd, 1999, 02:19 AM
#3
Re: How to attach a ToolBar to the main parent window
Hi Fabi,
I have a problem now. I have loaded this toolbar with a couple of buttons and one of them starts my application by creating a child window. ZThe problem is this child window HIDES MY LOADED TOOLBAR.
-
June 23rd, 1999, 02:34 AM
#4
Re: How to attach a ToolBar to the main parent window
How can a window hide your toolbar? Anyway using the last code, you can add this:
[ m_wndReBar.AddBar(&m_wndToolBar);]
After this you can show a band with m_wndReBar.ShowBand(0);//now it has be visible. It is(reply)?
Best regads,
Fabi
-
June 23rd, 1999, 02:49 AM
#5
Re: How to attach a ToolBar to the main parent window
Sorry I didn't tell you that Iam not Using CReBar but CToolBar. So I guess I cannot use AddBar() function.
-
June 23rd, 1999, 02:53 AM
#6
Re: How to attach a ToolBar to the main parent window
Try with : toolbar.ShowWindow(SW_SHOW). Ok?
-
June 23rd, 1999, 03:52 AM
#7
Re: How to attach a ToolBar to the main parent window
Nope!! Does,t work. Show I use GetClientRect() to reposition my child window or is there some other way. If you want to see my code ( to get a clear picture) I can email you.(if you have time for it)
-
June 23rd, 1999, 04:12 AM
#8
Re: How to attach a ToolBar to the main parent window
Ok, send me your code. Try to make it shortly.
-
June 23rd, 1999, 04:16 AM
#9
Re: How to attach a ToolBar to the main parent window
I forgot!!!!
Let me eat your code, a couple of hours. I have a break. I'll eat it after. Ok?
-
June 23rd, 1999, 04:25 AM
#10
Re: How to attach a ToolBar to the main parent window
But I need your email address for send you the code or do you want me to post them here itself?
-
June 23rd, 1999, 04:30 AM
#11
Re: How to attach a ToolBar to the main parent window
My e-mail : [email protected]. Ok?
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
|