PrimalForms - cant resize form

This forum can be browsed by the general public. Posting is no longer allowed as the product has been discontinued.
This topic is 12 years and 10 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
User avatar
boyds4sa
Posts: 1
Last visit: Fri May 27, 2011 8:52 am

PrimalForms - cant resize form

Post by boyds4sa »

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?
User avatar
davidc
Posts: 5913
Last visit: Mon Jul 08, 2019 8:55 am
Been upvoted: 2 times

PrimalForms - cant resize form

Post by davidc »

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
David
SAPIEN Technologies, Inc.
This topic is 12 years and 10 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.