Results 1 to 3 of 3

Thread: Form Help

  1. #1
    Join Date
    May 2007
    Location
    NSW, Australia
    Posts
    2,823
    Mentioned
    3 Post(s)
    Quoted
    25 Post(s)

    Default Form Help

    I need help with my form. When i run my script the form shows up and if i press the X it still plays how to make it terminate the script?

    Here is the closing code:
    SCAR Code:
    procedure InitFormOnExit(Sender: TObject; var Action: TCloseAction);
    begin
      if (not (frmDesign.ModalResult = mrOk)) then
        EndInitForm := False;
    end;
    Here is a peice of the form:

    SCAR Code:
    procedure InitForm;
    begin
    frmDesign := CreateForm;
    frmDesign.Left := 489;
    frmDesign.Top := 301;
    frmDesign.Width := 400;
    frmDesign.Height := 250;
    frmDesign.Caption := 'BH - East Varrock Yew Cutter';
    frmDesign.Color := clInactiveCaptionText;
    frmDesign.Font.Color := clWindowText;
    frmDesign.Font.Height := -11;
    frmDesign.Font.Name := 'MS Sans Serif';
    frmDesign.Font.Style := [];
    frmDesign.Visible := False;
    frmDesign.PixelsPerInch := 96;
    frmDesign.OnClose := @InitFormOnExit;

  2. #2
    Join Date
    Nov 2006
    Location
    NSW, Australia
    Posts
    3,487
    Mentioned
    1 Post(s)
    Quoted
    0 Post(s)

    Default

    procedure InitFormOnExit(Sender: TObject; var Action: TCloseAction);
    begin
    if (not (frmDesign.ModalResult = mrOk)) then
    EndInitForm := False;
    end;
    Instead try:

    SCAR Code:
    procedure InItFormOnExit(Senders : TObject);
    begin
      frmDesign.modalresult := Mrcancel;
    end;
    [CENTER][img]http://signatures.mylivesignature.com/54486/113/4539C8FAAF3EAB109A3CC1811EF0941B.png[/img][/CENTER]
    [CENTER][BANANA]TSN ~ Vacation! ~ says :I Love Santy[/BANANA][/CENTER]

    [CENTER][BANANA]Raymond - Oh rilie? says :Your smart[/BANANA][/CENTER]

  3. #3
    Join Date
    Dec 2006
    Location
    utah
    Posts
    1,427
    Mentioned
    2 Post(s)
    Quoted
    7 Post(s)

    Default

    this could help im tired...

    SCAR Code:
    program New;

    var
       StartScript : Boolean;

    procedure Onclose(Sender: TObject; var Action: TCloseAction);
    begin
      StartScript := (frmDesign.ModalResult = mrOk);
    end;

    /// Button := TBitBtn.Create(Your Form);
    /// Button.SetBounds(Left, Top, Width, Height : Integer);
    /// Button.Kind := bkOK;
    ///

    begin
    if StartScript then
    begin
       Writeln('do Stuff');

    end else
      Writeln('User Did not accept');
    end.

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
  •