2017-04-07 27 views
1

Powershellでフォームを作成しようとしています。しかし、私はそれがイメージを持っているときにボタンからパディングを削除することはできますか?あなたが写真で見ることができるように。画像とボタンの境界線の間にはスペースがあります。どうすれば削除できますか?ここでPowershellフォーム内に画像を埋め込みます。

http://imgur.com/a/5zhuN

$Item1But = New-Object system.windows.Forms.Button 
$Item1But.Text = "Keyboard" 
$Item1But.Width = 250 
$Item1But.Height = 50 
$Item1But.Image = [System.Drawing.Image]::Fromfile(".\Picture\Keyboard.gif") 
$Item1But.TextImageRelation = "ImageBeforeText" 
$Item1But.FlatStyle = [System.Windows.Forms.FlatStyle]::Flat 
$Item1But.FlatAppearance.BorderSize=2 
$Item1But.FlatAppearance.Bordercolor="red" 
$Item1But.location = new-object system.drawing.point(25,25) 
$Item1But.Font = "Microsoft Sans Serif,25" 
$Item1But.add_click($NewAction) 
$Form.controls.Add($Item1But) 

答えて

0

に動作していないMSDN on Padding

$Item1But.Padding = New-Object -TypeName System.Windows.Forms.Padding -ArgumentList (0,0,0,0) 
+0

です。まだ同じ :( – Pavel

関連する問題