PrimalForms - cant resize form

This forum can be browsed by the general public. Posting is no longer allowed as the product has been discontinued.
Locked
User avatar
boyds4sa
Posts: 1
Meble kuchenne na zamówienie - na wymiar - Wrocław
Joined: Fri May 27, 2011 8:44 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
Joined: Thu Aug 18, 2011 4:56 am

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.

Locked