C # Create custom form styles

Source: Internet
Author: User

Making irregular forms involves the invocation of APIs and a lot of programming, which is a very complicated matter. Below we can use Borland C # Builder to easily implement an irregular form, with an example to describe its production process.

I. Preparing irregular form bitmaps

Two. Setup of Forms

Three. Completion of the Code

I. Preparing irregular form bitmaps

For the sake of convenience, we look for a few other software skin.

Here, use the skins\ocean\kingdvd_disable.bmp in the installation directory of Jinshan shadow PA 2003.

Of course, you can use the drawing tool, make a bitmap with a shape, the background uses a special color, such as white. This color will be used in the back.

Two. Setup of Forms

1. New C # application

2. Select the newly created form and set its corresponding properties:

(1). Set the FormBorderStyle property to None.

(2). Set the BackgroundImage property of the form to the first bitmap file.

(3). Set the TransparencyKey property to the background color of the bitmap file, in this case white. (This property tells the application which parts of the form need to be set to transparent.) )

(4). Add a picturebox1, is a close bitmap, click on the application to close.

(5) Adding a contextMenu1, add a menu item "Exit" and set the WinForm ContextMenu to contextMenu1.

Press F9 to run your program and you'll see your irregular form.

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.