PrintPreviewDialog.TransparencyKey 属性

此属性支持 .NET 基础结构,但不适合在代码中直接使用。

获取或设置将表示窗体透明区域的颜色。

**命名空间:**System.Windows.Forms
**程序集:**System.Windows.Forms(在 system.windows.forms.dll 中)

语法

声明
Public Property TransparencyKey As Color
用法
Dim instance As PrintPreviewDialog
Dim value As Color

value = instance.TransparencyKey

instance.TransparencyKey = value
public Color TransparencyKey { get; set; }
public:
property Color TransparencyKey {
    Color get ();
    void set (Color value);
}
/** @property */
public Color get_TransparencyKey ()

/** @property */
public void set_TransparencyKey (Color value)
public function get TransparencyKey () : Color

public function set TransparencyKey (value : Color)

属性值

Color,表示要在窗体上透明显示的颜色。

备注

此属性与此类无关。

当将 Color 分配给 TransparencyKey 属性时,具有相同 BackColor 的窗体区域将透明显示。在窗体的透明区域执行的任何鼠标操作(如鼠标单击)都将传输到该透明区域下的窗口。例如,如果使窗体的工作区透明,则在该区域上单击鼠标会将单击的事件通知发送到该区域下的任何窗口。如果分配给 TransparencyKey 属性的颜色与窗体上的任何控件相同,则这些控件也将透明显示。例如,当某窗体的 TransparencyKey 属性设置为 Control 时,如果在该窗体上有一个 Button 控件,则该控件将透明显示,除非将 Button 控件的 BackColor 属性更改为其他颜色。

Windows 2000, Windows 2000 专业版, Windows 2000 Server, Windows 2000 Advanced Server 平台说明: 仅在 Windows 2000 操作系统下才支持透明窗口和区域。

平台

Windows 98、Windows 2000 SP4、Windows CE、Windows Millennium Edition、Windows Mobile for Pocket PC、Windows Mobile for Smartphone、Windows Server 2003、Windows XP Media Center Edition、Windows XP Professional x64 Edition、Windows XP SP2、Windows XP Starter Edition

.NET Framework 并不是对每个平台的所有版本都提供支持。有关受支持版本的列表,请参见系统要求

版本信息

.NET Framework

受以下版本支持:2.0、1.1、1.0

请参见

参考

PrintPreviewDialog 类
PrintPreviewDialog 成员
System.Windows.Forms 命名空间