Differences between ctoolbarctrl and ctoolbar

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.