How does one programmatically show/hide CToolBars 
Author Message
 How does one programmatically show/hide CToolBars

How does one programmatically show/hide CToolBars created as

int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
 {
 if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
  return -1;
 if (!m_wndToolBar.Create(this, WS_CHILD | WS_VISIBLE | CBRS_SIZE_DYNAMIC |
  CBRS_TOP | CBRS_TOOLTIPS | CBRS_FLYBY, 1000) ||
  !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))

What does one need to do to show/hide these via menu selections?



Sat, 13 Jul 2002 03:00:00 GMT  
 How does one programmatically show/hide CToolBars
CFrameWnd::ShowControlBar() is what you want.

An easier way is to make the menu item ID same as toolbar ID (1000 in your
case). In its handler, call OnBarCheck() in your CFrameWnd derived window.

--
Ajay Kalra

Microsoft VC++/MFC MVP

Note: Please post all replies to newsgroup only.


Quote:
> How does one programmatically show/hide CToolBars created as

> int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
>  {
>  if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
>   return -1;
>  if (!m_wndToolBar.Create(this, WS_CHILD | WS_VISIBLE | CBRS_SIZE_DYNAMIC
|
>   CBRS_TOP | CBRS_TOOLTIPS | CBRS_FLYBY, 1000) ||
>   !m_wndToolBar.LoadToolBar(IDR_MAINFRAME))

> What does one need to do to show/hide these via menu selections?



Sun, 14 Jul 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Save as: Web page Archive, can it be done programmatically

2. Programmatically disable/hid Submit Button

3. Windows "Show Desktop" programmatically

4. Hide Taskbar Programmatically Pt. II

5. Show AutoHide Taskbar Programmatically Pt. I

6. Tough: Hide TaskBar Programmatically

7. how:hide CListCtrl scroll bar and scroll programmatically

8. OnInitDialog and doing something after the window is shown

9. Some one 's done his homework

10. Any one done Tooltips in Property sheet?

11. show and hide colums of a datagrid

12. CDialogBar Show/hide

 

 
Powered by phpBB® Forum Software