SRL Archive - OSR Help

Lock form size


tom99

2010-03-04 04:33:10

what is the command to lock the size of a form in scar ?

basicly what i mean is that you lock the size so you cannot draw the form into less or larger size.

Dan Cardin

2010-03-04 06:41:24

you could make the formtype a bsdialog or something of the sort which does not allow for resizing

tom99

2010-03-04 07:13:17

I dont want to make a dialog, i want the main form to not allow rezising what is the command for this ?

Janilabo

2010-03-04 08:24:28

You can do this trick with Constraints:

var
form: TForm;

function buildForm: Boolean;
begin
form:= CreateForm;
form.SetBounds(0, 0, 500, 250);
form.Constraints.MaxHeight:= 250;
form.Constraints.MinHeight:= 250;
form.Constraints.MaxWidth:= 500;
form.Constraints.MinWidth:= 500;
form.Position:= poScreenCenter;
Result:= (form.ShowModal = mrOK);
end;

function loadForm: Variant;
var
v: TVariantArray;
begin
Result:= ThreadSafeCall('buildForm', v);
end;

begin
loadForm;
FreeForm(form);
end.
Is it what you want?

Wanted

2010-03-04 10:47:19

In the form editer there is a little box on the left that's called BorderStyle

Coh3n

2010-03-04 11:44:42


BorderStyle := bsSingle;

Dan Cardin

2010-03-04 15:51:30

Aha. very much couldn't remember the one that didn't allow resizing without taking away the buttons. At least I knew what I meant.

Sex

2010-03-04 22:41:47

You just pick a bs that doesn't have size in it. Like bsToolWindow bsSingle and such.

Coh3n

2010-03-04 23:23:12

From: Sex
You just pick a bs that doesn't have size in it. Like bsToolWindow bsSingle and such.

You don't happen to know of a reference list of all that sort of stuff (border styles, font styles, etc.)?

Sex

2010-03-04 23:52:38

Most of them are in Delphi :p. But if you press control space and type bs you will find a list of them (likewise for fontstyles, using fs).

Coh3n

2010-03-04 23:54:29

From: Sex
Most of them are in Delphi :p. But if you press control space and type bs you will find a list of them (likewise for fontstyles, using fs).

Wow, why didn't I think of that? :duh:

Thanks. Lol