Creating ToolBar in a dialog
-
Hello Guys: i want to craete a tool bar in my dialog Box i am using following code in the OnInitDialog() .......... m_ToolBar.Create(this); m_ToolBar.LoadToolBar(IDR_TOOLBAR1); m_ToolBar.ShowWindow(TRUE); but i can't see any toolbar, any solutions?.. Thanks Muhammad Ahmed ahmed
-
Hello Guys: i want to craete a tool bar in my dialog Box i am using following code in the OnInitDialog() .......... m_ToolBar.Create(this); m_ToolBar.LoadToolBar(IDR_TOOLBAR1); m_ToolBar.ShowWindow(TRUE); but i can't see any toolbar, any solutions?.. Thanks Muhammad Ahmed ahmed
-
i guess you forgot to make it visible: VERIFY( m_toolbar.Create(WS_CHILD | WS_VISIBLE | CCS_NOPARENTALIGN | CCS_NORESIZE | TBSTYLE_FLAT | TBSTYLE_TOOLTIPS, CRect(XX, XX, XX, XX), this, AFX_IDW_TOOLBAR) );
i've used m_ToolBar.CreateEx(this,TBSTYLE_FLAT,WS_CHILD | WS_VISIBLE | CBRS_ALIGN_TOP, CRect(10,10,100,100), AFX_IDW_TOOLBAR); m_ToolBar.LoadToolBar(IDR_TOOLBAR1); m_ToolBar.ShowWindow(TRUE); but toolbar is invisible
-
i've used m_ToolBar.CreateEx(this,TBSTYLE_FLAT,WS_CHILD | WS_VISIBLE | CBRS_ALIGN_TOP, CRect(10,10,100,100), AFX_IDW_TOOLBAR); m_ToolBar.LoadToolBar(IDR_TOOLBAR1); m_ToolBar.ShowWindow(TRUE); but toolbar is invisible
i've tested it. it works in my dialog. CListCtrl m_toolbar; m_toolbar.Create(WS_CHILD | WS_VISIBLE | CCS_NOPARENTALIGN | CCS_NORESIZE | TBSTYLE_FLAT | TBSTYLE_TOOLTIPS, CRect(0, 0, 100, 100), this, AFX_IDW_TOOLBAR); check if maybe sth in your program is on conflict with some of the styles.
-
i've tested it. it works in my dialog. CListCtrl m_toolbar; m_toolbar.Create(WS_CHILD | WS_VISIBLE | CCS_NOPARENTALIGN | CCS_NORESIZE | TBSTYLE_FLAT | TBSTYLE_TOOLTIPS, CRect(0, 0, 100, 100), this, AFX_IDW_TOOLBAR); check if maybe sth in your program is on conflict with some of the styles.
u've used CListCtrl m_toolbar; i am using CToolBar m_ToolBar; ahmed
-
u've used CListCtrl m_toolbar; i am using CToolBar m_ToolBar; ahmed
-
Hello Guys: i want to craete a tool bar in my dialog Box i am using following code in the OnInitDialog() .......... m_ToolBar.Create(this); m_ToolBar.LoadToolBar(IDR_TOOLBAR1); m_ToolBar.ShowWindow(TRUE); but i can't see any toolbar, any solutions?.. Thanks Muhammad Ahmed ahmed
You used
CToolBar
orCToolBarCtrl
? In dialogs, you should useCToolBarCtrl
.CToolBar
is useful only in frame windows (only frame windows support docking) Robert-Antonio "Love without sex is like a fish without antlers"