am unable to see any tooltips in the toolbar though i did set the prompt in the resource for the toolbar .button it's really ........ing me off ... please somebody tell me whats wrong
am unable to see any tooltips in the toolbar though i did set the prompt in the resource for the toolbar .button it's really ........ing me off ... please somebody tell me whats wrong
Have you added CBRS_TOOLTIPS style to the aother styles in the Create or SetBarStyle?
Check MSDN -> tooltips -> activating for more info.
Have a nice code!
[R]evolution!
Programming related articles, downloads, demos
here goes my code
m_ctb.CreateEx(this,TBSTYLE_TOOLTIPS |TBSTYLE_FLAT | TBSTYLE_TRANSPARENT |WS_CHILD | WS_VISIBLE );
m_ctb.LoadToolBar(IDR_TOOLBAR1);
m_ctb.EnableDocking(CBRS_ALIGN_ANY);
Try to eliminate TBSTYLE_TRANSPARENT. It might cause problems.
Quote from MSDN:
"TBSTYLE_TRANSPARENT :: Version 4.71. Creates a transparent toolbar. In a transparent toolbar, the toolbar is transparent but the buttons are not. Button text appears under button bitmaps. To prevent repainting problems, this style should be set before the toolbar control becomes visible."
As you see, it's version is also higher (e.g. TBSTYLE_FLAT is v 4.70).
[R]evolution!
Programming related articles, downloads, demos
nope it's still not working ... actually i resized my toolbar shamelessly copied the code from code guru ...without this the toolbar was not showing up ...now the damn tooltips are not coming
CRect rcClientOld; // Old Client Rect
CRect rcClientNew; // New Client Rect with Tollbar Added
GetClientRect(rcClientOld); // Retrive the Old Client WindowSize
// Called to reposition and resize control bars in the client
// area of a window. The reposQuery FLAG does not really draw the
// Toolbar. It only does the calculations. And puts the new
// ClientRect values in rcClientNew so we can do the rest of the
// Math.
RepositionBars(AFX_IDW_CONTROLBAR_FIRST,
AFX_IDW_CONTROLBAR_LAST,0,reposQuery,rcClientNew);
// All of the Child Windows (Controls) now need to be moved so
// the Tollbar does not cover them up. Offest to move all child
// controls after adding Tollbar
CPoint ptOffset(rcClientNew.left-rcClientOld.left,
rcClientNew.top-rcClientOld.top);
CRect rcChild;
// Handle to the Dialog Controls
CWnd* pwndChild = GetWindow(GW_CHILD);
while(pwndChild) // Cycle through all child controls
{
pwndChild->GetWindowRect(rcChild); // Get the child control RECT
ScreenToClient(rcChild);
// Changes the Child Rect by the values of the claculated offset
rcChild.OffsetRect(ptOffset);
pwndChild->MoveWindow(rcChild,FALSE); // Move the Child Control
pwndChild = pwndChild->GetNextWindow();
}
CRect rcWindow;
GetWindowRect(rcWindow); // Get the RECT of the Dialog
// Increase width to new Client Width
rcWindow.right += rcClientOld.Width() - rcClientNew.Width();
// Increase height to new Client Height
rcWindow.bottom += rcClientOld.Height() - rcClientNew.Height();
MoveWindow(rcWindow,FALSE); // Redraw Window
// Now we REALLY Redraw the Toolbar
RepositionBars(AFX_IDW_CONTROLBAR_FIRST,
AFX_IDW_CONTROLBAR_LAST,0);
If you need modify the toolbars position/size, you must use CCS_ADJUSTABLE style, which (quote from MSDN)
"Allows toolbars to be customized by the user. If this style is used, the toolbar’s owner window must handle the customization notification messages sent by the toolbar, as described in CToolBarCtrl: Handling Customization Notifications."
If you prefer to use this style instead of CCS_TOP (default), you need to manage the workarounds needed...
I guess that's your problem, but a debug session will show you the real problem.
[R]evolution!
Programming related articles, downloads, demos