I am trying to dynamically resize a form when I click on a button. The default size of the form is 700,130. when I click on a button I execute the following script.
$button_click={
$formname.size.height = 700
}
but the form height doesn't change when I click on the button.
Any clue why this doesn't work?
PrimalForms - cant resize form
PrimalForms - cant resize form
The form only detects the change if you change the Size property itself. Try this instead:
$width = $form1.Size.Width
$height = 700
$form1.Size = New-Object System.Drawing.Size ($width, $height)
Or you can use the SetBounds method:
$form1.SetBounds($form1.Location.X, $form1.Location.Y, 700, $form1.Size.Width)davidc2011-05-27 16:52:58
$width = $form1.Size.Width
$height = 700
$form1.Size = New-Object System.Drawing.Size ($width, $height)
Or you can use the SetBounds method:
$form1.SetBounds($form1.Location.X, $form1.Location.Y, 700, $form1.Size.Width)davidc2011-05-27 16:52:58
David
SAPIEN Technologies, Inc.
SAPIEN Technologies, Inc.