Results 1 to 11 of 11

Thread: Lock form size

  1. #1
    Join Date
    Nov 2009
    Posts
    471
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default Lock form size

    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.

  2. #2
    Join Date
    Apr 2007
    Posts
    3,152
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    you could make the formtype a bsdialog or something of the sort which does not allow for resizing
    SCAR Tutorials: The Form Tutorial | Types, Arrays, and Classes
    Programming Projects: NotePad | Tetris | Chess


  3. #3
    Join Date
    Nov 2009
    Posts
    471
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

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

  4. #4
    Join Date
    Feb 2006
    Location
    Helsinki, Finland
    Posts
    1,395
    Mentioned
    30 Post(s)
    Quoted
    107 Post(s)

    Default

    You can do this trick with Constraints:

    SCAR Code:
    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?

  5. #5
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

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

  6. #6
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    SCAR Code:
    BorderStyle := bsSingle;

  7. #7
    Join Date
    Apr 2007
    Posts
    3,152
    Mentioned
    3 Post(s)
    Quoted
    1 Post(s)

    Default

    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.
    SCAR Tutorials: The Form Tutorial | Types, Arrays, and Classes
    Programming Projects: NotePad | Tetris | Chess


  8. #8
    Join Date
    Oct 2009
    Location
    Stockton, CA
    Posts
    2,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    You just pick a bs that doesn't have size in it. Like bsToolWindow bsSingle and such.
    Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
    Quote Originally Posted by #srl
    10:45 < Toter> daphil when can get sex anyday I want
    10:45 < Toter> he is always on #SRL
    "A programmer is just a tool which converts caffeine into code"

  9. #9
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Quote Originally Posted by Sex View Post
    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.)?

  10. #10
    Join Date
    Oct 2009
    Location
    Stockton, CA
    Posts
    2,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Most of them are in Delphi . But if you press control space and type bs you will find a list of them (likewise for fontstyles, using fs).
    Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
    Quote Originally Posted by #srl
    10:45 < Toter> daphil when can get sex anyday I want
    10:45 < Toter> he is always on #SRL
    "A programmer is just a tool which converts caffeine into code"

  11. #11
    Join Date
    Apr 2008
    Location
    Marquette, MI
    Posts
    15,252
    Mentioned
    138 Post(s)
    Quoted
    680 Post(s)

    Default

    Quote Originally Posted by Sex View Post
    Most of them are in Delphi . 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?

    Thanks. Lol

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •