Cstatusbar, cstatusbarctrl, ctoolbar, and ctoolbarctrl are inherited from the cwnd class.
Both ctoolbar and cstatusbar are encapsulated in the control bars class, while both cstatusbarctrl and ctoolbarctrl are in the controls class.
.
Ctoolbarctrl and cstatusbar do not add additional functions because they simply encapsulate APIs,
Therefore, the toolbar and status bar created by them will not provide more functions than the API version.
They cannot be moved or docked by users or vertically aligned. They can only be used to set and control buttons and panes more easily within the control bar,
Therefore, to obtain desired functions, you must create your own control bar,
This requires two other MFC classes: ctoolbar and cstatusbar.
Using ctoolbar to create a toolbar is easy, and you do not need to consider the rect parameter. But the greatest convenience
Also, when loading bitmap and definition buttons: ctoolbar TB; TB. loadtoolbar (uint ID );
In this case, you do not need to define the bitmap and each button programmatically. You can use the toolbar editor to create a resource to be referenced.
Using these classes, loadtoolbar not only makes it easier to load and configure control bars, but also provides the following enhanced functions:
Using the ctoolbar class, the color of the bitmap used in the toolbar automatically changes with the color of the current button. Light gray
Is a standard Windows button surface color, however, if you are sure to choose a new color scheme for your desktop (for example
If the toolbar is still dimmed, the button looks as if it has deviated from its original position. Therefore,
The ctoolbar converts them into the current button color. According to the inheritance idea of C ++, The ctoolbar and cstausbar classes can be considered
Is derived from ctoolbarctrl and cstatusbarctrl, so you can inherit the functions of both.