To implement transparent buttons, three controls are required in total - image, label, and bevel. The image control is placed to highlight the transparent effect (as the background), and the label is to display the words on the key. The bevel displays a three-dimensional box. (This control can achieve the effect of showing a protruding effect when the mouse moves to the button) Let’s take a look at the specific steps below.
1. Please build a project file in delphi6.0 first
2. Please select a picture first and pay attention to its size. Then adjust the form to the same size as the picture.
3. Then place an image control on the form and adjust its Align attribute to alclient. In this way, the urine and defecation of the image are exactly the same as the size of the form, and it can be used as the background. Then select the picture property and click the small button. Press the load key in the pop-up window to select the picture you want to use as the background.
4. Then place a label control on the form and set the text content and font size of the button reasonably. Click the Transparent property to set the label as transparent.
5. Finally, place a bevel control on the form. Set the shape attribute to bsBOX, then set the style attribute to bsRaise (this is a sudden effect), and change the visible attribute to false (this program is not visible when running).
6. Reasonably set the positions of label and bevel controls so that the positions and positions of bevel and label controls are just the same. If you think it is difficult to adjust the position using the mouse. You can use Ctrl+arrow to micro-shift the control and use Shift+arrow to fine-size the control.
Let’s start programming now. Please set the following events and statements in the code window.
In addition, in order to ensure that the transparent button does not look very monotonous, you can also place an icon near the label control, which will make the user look more clear.