It doesn't set it to the right size - it's always bigger. Has anybody any
idea's?
CString Text = "Hello";
CDC *dc = m_wndStatusBar.GetDC();
CSize s = dc->GetTextExtent( Text );
m_wndStatusBar.SetPaneInfo(1, ID_MY_PANE, SBPS_POPOUT, s.cx);
m_wndStatusBar.ReleaseDC(dc);
m_wndStatusBar.SetPaneText( 1,Text );
Thanks,
Andy Kassell
Senior Project Engineer
Penny+Giles Instrumentation Ltd
http://www.p-ginst.co.uk
Eric Jucker <er...@deltanet.com> wrote in article
<331AB0...@deltanet.com>...
> try this:
>
> UINT uID;
> UINT uStyle;
> int nWidth;
> CRect rect;
> CString Text = "Hello";
> m_wndStatusBar.GetPaneInfo( 1, uID, uStyle, nWidth );
> CDC *dc = m_wndStatusBar.GetDC();
> dc->SelectObject( m_wndStatusBar.GetFont( ));
> dc->DrawText( Text , -1, rect, DT_SINGLELINE | DT_CALCRECT );
> m_wndStatusBar.ReleaseDC( dc );
> m_wndStatusBar.SetPaneInfo( 1, uID, SBPS_POPOUT, rectArea.Width() );
>
> I remember having troubles also with SetPaneText(} and resolved it with
> m_wndStatusBar.GetStatusBarCtrl().SetText( Text, 0, SBT_NOBORDERS );
>
> Eric Jucker
> SimExel Corp.
> http://www.simexel.com
>