Powershell form padding of picture in button -
im trying create form in powershell. cant figure out how can remove padding button when have image in it? can see on picture. there space between picture , border of button. how can remove it?
$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)
here msdn on padding
$item1but.padding = new-object -typename system.windows.forms.padding -argumentlist (0,0,0,0)
Comments
Post a Comment