
This property is not supported when RightToLeftLayout is true. Opacity differs from the transparency provided by TransparencyKey, which only makes a form and its controls completely transparent if they are the same color as the value specified in the TransparencyKey property.

For example, you can phase a form into view by setting the Opacity property to a value of 0 percent (0.00) and gradually increasing the value until it reaches 100 percent (1.00).

You can use this property to provide different levels of transparency or to provide effects such as phasing a form in or out of view. Setting this property to a value of 0 percent (0.00) makes the form completely invisible. When this property is set to a value less than 100 percent (1.00), the entire form, including borders, is made more transparent. The Opacity property enables you to specify a level of transparency for the form and its controls. ' Display the form as a modal dialog box. ' Display the form in the center of the screen.įorm2.StartPosition = FormStartPosition.CenterScreen ' Size the form to be 300 pixels in height and width. Display the form as a modal dialog box.įorm2.StartPosition = FormStartPosition.CenterScreen Display the form in the center of the screen.įorm2->StartPosition = FormStartPosition::CenterScreen Size the form to be 300 pixels in height and width.įorm2->Size = System::Drawing::Size( 300, 300 ) Set the text displayed in the caption. This example assumes that the CreateMyOpaqueForm method is called from another form in an event handler or other method.

The example also sets the Size property to provide a larger sized form than the default size of the form. It creates a new form that is positioned in the center of the screen with an Opacity property set to change the opacity level of the form.
Image opacity vb.net how to#
The following example demonstrates how to create a form that is displayed with an opacity level of 75 percent.
