CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 1999
    Posts
    4

    move tooltip to another position



    In my application, I add a dialog bar with some fields with tooltip also. The tooltip are generated using the default

    CToolTipCtrl inside the dialog bar, and I change the text intercepting the message TTN_NEEDTEXT, with something like

    this:

    BOOL CMyDlgBar::OnToolTipNeedText( UINT id, NMHDR *pNMHDR, LRESULT *pResult )

    {

    BOOL bHandleNotify = FALSE;

    TOOLTIPTEXT *pTTT = (TOOLTIPTEXT*)pNMHDR;

    UINT pos;

    nID = ::GetDlgCtrlID( (HWND)pNMHDR->idFrom );

    switch( nID )

    {

    case IDC_FLD1:

    pTTT->lpszText = "my tooltip;

    bHandleNotify = TRUE;

    break;

    }

    return bHandleNotify;

    }

    The tooltip default position is centered and under the field: does anybody knows how I can move it to another position

    (ie to the left of the field) ?

    Thanks everybody

  2. #2
    Join Date
    Apr 1999
    Posts
    10

    Re: move tooltip to another position


    BOOL ::OnToolTipNotify( UINT id, NMHDR * pNMHDR, LRESULT * pResult )

    ...........

    ::MoveWindow( pNMHDR->hwndFrom,
    nX,
    nY,
    nWidth,
    nHeight,
    bRepaint);

    ..........





Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured