Professional UI Solutions
Site Map   /  Register


Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS General Discussion » How to add tooltip in the CExtGridCell? Collapse All
Subject Author Date
mai mike Aug 6, 2007 - 7:58 AM

I wan to add a tooltip in the grid cell when the mouse hover over the special cell(such as the last column of every row).
How can i implement this feature?

Thank you


Technical Support Apr 23, 2008 - 6:22 AM

Please implement the following virtual method in your CExtGridWnd-derived class:

virtual void OnAdvancedPopupMenuTipWndDisplay(
      CExtPopupMenuTipWnd & _ATTW,
      const RECT & rcExcludeArea
      ) const;

void CYourGridWnd::OnAdvancedPopupMenuTipWndDisplay(
      CExtPopupMenuTipWnd & _ATTW,
      const RECT & rcExcludeArea
      ) const
      ASSERT_VALID( this );
      _ATTW.SetTipStyle( CExtPopupMenuTipWnd::__ETS_BALLOON_NO_ICON );
      _ATTW.Show( (CWnd*)this, rcExcludeArea );
The grid control supports both advanced tooltips and cell expanding features. These features are different and based on different controls. The tooltips are CExtPopupMenuTipWnd windows and they are always located near grid cells regardless of whether the balloon shape or classic rectangular shape is applied. The expand windows are CExtContentExpandWnd objects and they are always located over cells. Please ensure you are using tooltips and not cell content expanding feature. Your grid should use appropriate __EGBS_EX_CELL_TOOLTIPS_*** and/or __EGBS_EX_CELL_EXPANDING_*** style sets.

mai mike Aug 7, 2007 - 7:14 AM


How can i do it?
Please give some suggestion.
Thank you


Technical Support Aug 9, 2007 - 5:10 AM

You should use a CExtGridWnd-derived class which handles WM_MOUSEMOVE messages. It should have a CExtPopupMenuTipWnd tooltip member and display it over particular grid cells using the CExtPopupMenuTipWnd::Show() method when the mouse is moved over the grid window. This means your grid window should keep the rectangle coordinates of the grid cell which is covered by the mouse. The CExtGridBaseWnd::HitTest() method performs hit testing. The CExtGridWnd::GridCellRectsGet() method allows you to get the entire cell rectangle and/or rectangles of cell parts. Using these two methods you can detect which grid cell is covered by the mouse and show tooltip for it. If the mouse is moved to some short distance and still covers the same cell, then you should not show tooltip for it. You should not think about hiding tooltip at all because it destroys itself automatically (the CExtPopupMenuTipWnd::Show() method has cell rectangle in parameters what allows tooltip window to hide itself when mouse is moved outside rectangle).

Ulrich Heinicke Apr 21, 2008 - 12:03 PM

Do you have an example for that ?

If yes, could you mail it to me ?



Technical Support Apr 22, 2008 - 8:39 AM
Technical Support Aug 6, 2007 - 8:56 AM

This kind of tooltips is not supported in the grid window. It should be implemented by handing mouse movement events over the grid window and displaying the tooltip control hosted in your code.