|
i'm not sure if i got that right. you've got a CToolBar obj and want to hide / show it?
use CWnd::ShowWindow() with SW_SHOW / SW_HIDE.
hope this helps
|
|
|
|
|
Hi..
You are absolutely right!
I have a CToolBar object which needs to be hide/show as we click on menu item VIEW->ToolBar...i tried with ShowWindow(SW_HIDE),but its making the toolbar inactive instead of hiding.
Could you help me to solve this issue.
|
|
|
|
|
i've tried it and it works.
// your obj
CToolBarCtrl m_toolbar;
VERIFY( m_toolbar.Create(WS_CHILD | WS_VISIBLE | CCS_NOPARENTALIGN |
CCS_NORESIZE | TBSTYLE_FLAT | TBSTYLE_TOOLTIPS, CRect(10, 10, 100, 100),
this, AFX_IDW_TOOLBAR) );
// later on
m_toolbar.ShowWindow(SW_HIDE);
i rather use the CToolBarCtrl class, but if you don't want to, you can use CToolBar::GetToolBarCtrl() to get the CToolBar's underlying CToolBarCtrl class.
|
|
|
|
|
Hi Philipp Roesch,
This is the code iam following...
IN .H FILE
CToolBar m_Annot;
IN .CPP FILE(OnCreate() function)
if (!m_Annot.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_ALIGN_LEFT
| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY) ||
!m_Annot.LoadToolBar(IDB_BITMAP10))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
IN THE MENU HANDLING FUNCTION WHERE I NEED TO SHOW AND HIDE TOOLBAR
m_Annot.ShowWindow(SW_HIDE);
I tried to use CToolBar::GetToolBarCtrl(), but its not working....
|
|
|
|
|
ahhh, ok!
write this:
IN .H FILE
CToolBar m_Annot;
IN .CPP FILE(OnCreate() function)
if (!m_Annot.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_ALIGN_LEFT
| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY) ||
!m_Annot.LoadToolBar(IDB_BITMAP10))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
m_Annot.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_Annot);
IN THE MENU HANDLING FUNCTION WHERE I NEED TO SHOW AND HIDE TOOLBAR
m_Annot.ShowWindow(SW_HIDE);
|
|
|
|
|
HI PHILIPP ROESCH,
THANKS A LOT FOR YOUR SUGGESTION.NOW ITS WORKING.
BYE..
|
|
|
|
|
Hi,
Is it somehow possible to have the horizontal scrollbar always visible in my listctrl?
Or actually the problem is that with n fixed length columns it looks ugly if I leave room for the scrollbar which isn't there (kind of a (n+i)th column). And if I don't reserve that space for it, it looks ugly when the scrollbar appears because also the vertical scrollbar is shown.
Which solution would be good style in this situation?
|
|
|
|
|
Hi,
Is it somehow possible to have the horizontal scrollbar always visible in my listctrl?
Or actually the problem is that with n fixed length columns it looks ugly if I leave room for the scrollbar which isn't there (kind of a (n+i)th column). And if I don't reserve that space for it, it looks ugly when the scrollbar appears because also the vertical scrollbar is shown.
Which solution would good style in this situation?
|
|
|
|
|
Hi. I am currently using MDI mfc programming for my application and I have used pDC->TextOut(.) to display certain text in one of the child window. However, when the other window is on top of the one with the text, when it is move away, the text disappear. How can I resolve this? Thank you for any advise.
|
|
|
|
|
Make sure that you are doing your drawing in the view's OnDraw(...) function.
If I remember correctly, that should solve your problem.
Happy Programming!
WWW::CodeProject::BNEACETP
|
|
|
|
|
How can I detect if a user clicked outside a modal dialog?
|
|
|
|
|
Use mouse hooking by calling SetWindowsHookEx
|
|
|
|
|
Or get "control" over the mouse by calling "SetCapture". When use clicks you will get the click in your OnLbnDown ... and you check the mouse position.
Normally if you don't need that click you should imediatelly release the mouse by: ReleaseCapture.
Tutu.
|
|
|
|
|
Hi,
how can i integrate MSDN with Visual Studio 6. VS6 is alreay installed. now i have installed MSDN but when i press F1 in VS6, it says no MSDN collection. plz guide how can i tell VS6 about MSDN.
thanks,
omar lodhi
|
|
|
|
|
Run Installation CD of VS 6.0 again U can skip reintalling the software again by making no changes in the installed and uninstalled Features. After successful installation the Software automatically ask for MSDN CD.
I knew other ways, but since I did it long time ago I can't tell U precise way.
Hope is helps
Cheers!!!!
Siddharth
|
|
|
|
|
great wrote:
how can i integrate MSDN with Visual Studio 6. VS6 is alreay installed. now i have installed MSDN but when i press F1 in VS6, it says no MSDN collection. plz guide how can i tell VS6 about MSDN.
Which version of MSDN have you installed. If it is after October 2002, then it won't integrate with VS6, it only integrates with VS.NET and later.
Michael
But you know when the truth is told,
That you can get what you want or you can just get old,
Your're going to kick off before you even get halfway through.
When will you realise... Vienna waits for you? - "The Stranger," Billy Joel
|
|
|
|
|
I hope that's a typo - to the best of my knowledge, October 2001 is the cutoff date.
Steve S
|
|
|
|
|
Steve S wrote:
I hope that's a typo - to the best of my knowledge, October 2001 is the cutoff date.
You might be right. I thought it was Oct 2002 but I haven't got my disks handy to check. 2001 seems such a long time ago. All I know for sure it was October some year
Michael
But you know when the truth is told,
That you can get what you want or you can just get old,
Your're going to kick off before you even get halfway through.
When will you realise... Vienna waits for you? - "The Stranger," Billy Joel
|
|
|
|
|
Depending on your MSDN version it may not be possible to link directly with VC6. I believe that after January 2002 the MSDN only links with .NET it is still accessable through its shortcut however.
Sorry it may be January 2002 is the 1st .NET only version.
Ant.
|
|
|
|
|
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 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
|
|
|
|
|
sorry, i'm still asleep.
i've used CToolBarCtrl.
|
|
|
|