【发布时间】:2018-02-06 21:07:43
【问题描述】:
我无法将System.Winfows.Forms.Label 背景设置为透明。
在 C# 中很简单:
this.label1.BackColor = System.Drawing.Color.Transparent;
但是,在我的 PowerShell GUI 中,我无法获得相同的结果。我尝试了许多变体,但没有一个成功:
$my_label = New-Object System.Windows.Forms.Label
$my_label.BackColor = System.Drawing.Color.FromName("Transparent")
或
$my_color = New-Object System.Drawing.Color.Transparent
$my_label.BackColor = $my_color
在 C# 中,您可以超越这些样本,结果标签的背景变得透明。然而,在 PowerShell 中,每次尝试都会导致不同的错误。
我没有考虑过什么吗?
【问题讨论】:
-
那些错误是... 什么?
-
@AnsgarWiechers 如果有机会快速将输出更改为英语,我可以发布它们
标签: .net winforms powershell