【发布时间】:2019-04-24 03:49:21
【问题描述】:
需要应用哪些属性来改变Tabpage上文字的前景色和背景色?
看图: https://imgur.com/a/Su8aSg7
这是我的代码:
$TabControl_Main = New-Object System.Windows.Forms.TabControl
$TabControl_Main.Location = New-Object System.Drawing.Size(20,550)
$TabControl_Main.Size = New-Object System.Drawing.Size(850,270)
$form_MainForm.Controls.Add($TabControl_Main)
$TabPage1 = New-Object System.Windows.Forms.TabPage
$TabPage1.Location = New-Object System.Drawing.Size(20,550)
$TabPage1.Size = New-Object System.Drawing.Size(850,270)
$TabPage1.Text = "Processes"
$TabControl_Main.Controls.Add($TabPage1)
【问题讨论】:
-
$TabControl_Main.BackColor = New-Object System.Drawing.Color("Red")应该作为示例使用 -
我想更改每个选项卡上每个文本的颜色:)。您在此处编写的此代码会导致以下错误:“New-Object : A constructor was not found. Cannot find a proper constructor for type System.Drawing.Color.”
-
$TabControl_Main.BackColor = [System.Drawing.Color]::Red应该这样做。 -
不工作。 :(
标签: winforms powershell