Hi
How do i change the form size from a button press.
The form is 300,300
want to press a button and change the Height to 400 but nothing happen when i click?
$button1_Click={
#TODO: Place custom script here
$form1.Size.Height = "400"
}
Change formsize with button action
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Re: Change formsize with button action
found the way
viewtopic.php?t=1751
mark as solved.
viewtopic.php?t=1751
Code: Select all
$button1_Click={
#TODO: Place custom script here
if ($form1.Size.Height -eq 400) {
$height = 300
}
else
{
$height = 400
}
$width = $form1.Size.Width
$form1.Size = New-Object System.Drawing.Size ($width, $height)
}