PrintPreviewDialog.TransparencyKey PrintPreviewDialog.TransparencyKey PrintPreviewDialog.TransparencyKey PrintPreviewDialog.TransparencyKey Property


获取或设置将表示窗体透明区域的颜色。Gets or sets the color that will represent transparent areas of the form.

 property System::Drawing::Color TransparencyKey { System::Drawing::Color get(); void set(System::Drawing::Color value); };
public System.Drawing.Color TransparencyKey { get; set; }
member this.TransparencyKey : System.Drawing.Color with get, set
Public Property TransparencyKey As Color


Color,表示要在窗体上透明显示的颜色。A Color that represents the color to display transparently on the form.


此属性与此类无关。This property is not relevant for this class.

为属性赋值时, 将以透明方式显示窗体中具有相同BackColor区域的区域。 Color TransparencyKeyWhen the TransparencyKey property is assigned a Color, the areas of the form that have the same BackColor will be displayed transparently. 在窗体的透明区域上执行的任何鼠标动作 (例如鼠标单击) 都将被传输到透明区域下的窗口。Any mouse actions, such as the click of the mouse, that are performed on the transparent areas of the form will be transferred to the windows below the transparent area. 例如, 如果将窗体的客户端区域设为透明, 则单击该区域中的鼠标会将单击的事件通知发送到其下的任何窗口。For example, if the client region of a form is made transparent, clicking the mouse on that area will send the event notification of the click to any window that is below it. 如果分配TransparencyKey给属性的颜色与窗体上的任何控件相同, 它们也将以透明方式显示。If the color assigned to the TransparencyKey property is the same as any controls on the form, they also will be displayed transparently. 例如, 如果窗体上有Button一个控件的TransparencyKey属性设置为Control, 则该控件将以透明方式显示, 除非Button控件的BackColor属性更改为其他颜色。For example, if you have a Button control on a form that has its TransparencyKey property set to Control, the control will be displayed transparently unless the BackColor property of the Button control is changed to a different color.