VC: Hide the ctabctrl tag button

Source: Internet
Author: User

Purpose: To hide the ctabctrl label button, and use a drop-down box or menu to switch the ctabctrl label page. It looks like a single dialog box page, but in fact it is ctabctrl.

Some people may think this is not a bit Bt. In fact, I don't want to do such a thing. There is really no way. Now I want to change the multi-window interface created on the tab page.Code.

Implementation Method:

Use setpadding to set the size of the tag button and setitemsize to set the size of the tab.

The Code is as follows:
M_tab_main.setpadding (csize (-1000,-1000); // adjust this value as appropriate.
M_tab_main.setitemsize (csize (0, 0 ));

Is this code shameless? Haha, the height and width of the tag button are reduced by 1000 pixels, and the size of the tag button is 0.

This still doesn't work. The button is gone, but the original button is left blank, which is very indecent. The following code is OK.
Crect rect;
M_tab_main.getclientrect (& rect );
Rect. Top-= 20;
M_tab_main.movewindow (& rect );

Here, move ctabctrl up to 20 pixels. Because the height of the tag button is 24, but 24 is not allowed. If 24 is subtracted, the upper boundary of ctabctrl is removed, which is not elegant.

In this way, the goal is achieved.

Note: Because I only use the ctabctrl control in the main window, I move the ctabctrl control up and move it out of the window, so I cannot see the above part. However, if the ctabctrl and the main window are different in size, or the upper boundary of the upper boundary is not aligned with the upper boundary of the main window, the Movement will not work. In this case, you can place ctabctrl in a dialog box so that the ctabctrl size is the same as that of the dialog box. You can use this dialog box as a control to place it in the original ctabctrl position in the main window, in this way, the above Code is still feasible.

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.