Form.Opacity 属性  [C#]请参见
Form 类 | Form 成员 | System.Windows.Forms 命名空间 | TransparencyKey | 创建透明 Windows 窗体 | Form 成员(Visual J# 语法) | C++ 托管扩展编程 要求
平台: Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 系列语言
C#C++JScriptVisual Basic全部显示
获取或设置窗体的不透明度级别。
[Visual Basic]
Public Property Opacity As Double
[C#]
public double Opacity {get; set;}
[C++]
public: __property double get_Opacity();
public: __property void set_Opacity(double);
[JScript]
public function get Opacity() : double;
public function set Opacity(double);
属性值
窗体的不透明度级别。默认值为 1.00。
备注
此属性使您得以指定窗体及其控件的透明度级别。此属性与 TransparencyKey 提供的透明度不同,后者只能使窗体及其控件完全透明,条件是当窗体及其控件与 TransparencyKey 属性中指定的值所表示的颜色相同。当将此属性设置为小于 100% (1.00) 的值时,将使整个窗体(包括边框)更透明。将此属性设置为值 0% (0.00) 时,将使该窗体完全不可见。可以使用此属性提供不同级别的透明度,或者提供如窗体逐渐进入或退出视野这样的效果。例如,可以通过将 Opacity 属性设置为值 0% (0.00),并逐渐增加该值直到它到达 100% (1.00),来使某窗体逐渐进入视野。
Windows 2000, Windows Server 2003 系列平台说明:  此属性在无法显示分层窗口的平台上不起作用。
示例
[Visual Basic, C#] 下面的示例演示如何创建以 75%不透明度显示的窗体。该代码示例创建一个新窗体,该窗体位于屏幕的中央,其 Opacity 属性被设置为更改窗体的不透明度。该代码示例还设置 Size 属性来提供大于默认窗体大小的窗体。该示例假定在该示例中定义的方法是从事件处理程序的另一个窗体或其他方法中调用。
[Visual Basic] 
Private Sub CreateMyOpaqueForm()
   ' Create a new form.
   Dim form2 As New Form()
   ' Set the text displayed in the caption.
   form2.Text = "My Form"
   ' Set the opacity to 75%.
   form2.Opacity = 0.75
   ' Size the form to be 300 pixels in height and width.
   form2.Size = New Size(300, 300)
   ' Display the form in the center of the screen.
   form2.StartPosition = FormStartPosition.CenterScreen   ' Display the form as a modal dialog box.
   form2.ShowDialog()
End Sub
[C#] 
private void CreateMyOpaqueForm()
{
   // Create a new form.
   Form form2 = new Form();
   // Set the text displayed in the caption.
   form2.Text = "My Form";
   // Set the opacity to 75%.
   form2.Opacity = .75;
   // Size the form to be 300 pixels in height and width.
   form2.Size = new Size(300,300);
   // Display the form in the center of the screen.
   form2.StartPosition = FormStartPosition.CenterScreen;   // Display the form as a modal dialog box.
   form2.ShowDialog();
}
参考
http://expert.csdn.net/Expert/topic/2341/2341674.xml?temp=.7177088

解决方案 »

  1.   

    [Visual Basic]
    Public Property Opacity As Double
    [C#]
    public double Opacity {get; set;}
    [C++]
    public: __property double get_Opacity();
    public: __property void set_Opacity(double);
    [JScript]
    public function get Opacity() : double;
    public function set Opacity(double);
    这些是msdn里看的么我的msdn就是不能看很多东西啊,固定的我知道很简单的在属性里就可以解决,谢谢了
      

  2.   

    怎么没人帮我啊,我的msdn用不了所以什么都没有帮查看啊,现在我连vb.net的resize的帮助都看不了,我想让里面的几个控件随窗口的变化而变化,但是不知道怎么写了6.0的很简单的在vb.net里写不来了