You have two options where both requires deriving a class from the
CStatusBar Class[
^] or the
CMFCStatusBar Class[
^].
Change the type of
m_wndStatusBar
in your main frame window class header file to the derived class and include the header file of the derived class. If necessary create and initialise
m_wndStatusBar
in
OnCreate
of the main frame class.
The first method is overriding
CStatusBar::DrawItem
resp.
CMFCStatusBar::OnDrawPane
to do the drawing as required. This requires that the passed string contains a delimeter that is used to split it into the left and right parts.
The second method would be adding a pane for the right aligned text. The disadvantage of this solution is that the fixed space of the additional pane can't be used by the leftmost pane anymore (assuming using the style
SBPS_STRETCH
which lets this pane occupy the remaining available space). The advantage of this solution is that you can set the left and right text independently. But to show right aligned text you have to use ownerdraw for that pane too.