In VC, the picture control dynamically changes the background and the control is covered by the picture solution.

Source: Internet
Author: User

The picture control in VC is actually a cstatic type. Once you know this, the first problem is very easy.

Cstatic * PS = (cstatic *) getdlgitem (idc_static); // picture is of the cstatic type
Cbitmap CB;
CB. loadbitmap (idb_testground );
PS-> setbitmap (hbitmap (CB); // convert it to hbitmap forcibly

There is a problem when using this picture control, that is, some controls may be covered by the background image set in picture. The solution is shown on the Internet. The test is successful as follows:
Open the resource file (that is, the. RC file of the project, and find the definition of the corresponding dialog box:
For example:

Idd_picture_dialog dialogex 0, 0,529,400
Style ws_popup | ws_visible
Exstyle ws_ex_appwindow
Font 9, ""
Begin
Control 150, idc_static, "static", ss_bitmap, 533,400
Control "list1", idc_list1, "syslistview32", lvs_report | ws_border |
Ws_tabstop, 27,121,203,162
Control "progress1", idc_progress1, "msctls_progress32", ws_border,
102,320,316, 6, ws_ex_transparent
End

Between this in and end is defined as the control of the dialog box, adjust the positions of these statements, the more at the bottom of the front.
This is a direct method, the fundamental method, but there is a simple method in the operation, is to select all the controls in the editing interface Ctrl + A, and then hold down shift, cancel the selection of the image control, cut and paste the remaining controls so that the image controls are at the bottom layer and the resource files have been changed.

 

Welcome to my MSN space: http://jkflyfox.spaces.live.com

Areas of interest:. NET development, sqlserver database development, VC development, and wince embedded development

Recently, many development projects have been developed for wince.

For more information, please advise.

 

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.