Results 1 to 5 of 5

Thread: Form Help

  1. #1
    Join Date
    Aug 2007
    Location
    Georgia, U.S.
    Posts
    890
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default Form Help

    I keep getting this error when i try to run this:

    [Runtime Error] : Exception: Cannot make a visible window modal in line 84 in script

    SCAR Code:
    Program MyScript;
    {.include SRL/SRL.scar}

    var
      frmDesign : TForm;
      Ok : TButton;
      Edit1 : TEdit;
      Username : TEdit;

    procedure InitForm;
    begin
    frmDesign := CreateForm;
    frmDesign.Left := 250;
    frmDesign.Top := 114;
    frmDesign.Width := 277;
    frmDesign.Height := 396;
    frmDesign.Caption := 'frmDesign';
    frmDesign.Color := clBtnFace;
    frmDesign.Font.Color := clWindowText;
    frmDesign.Font.Height := -11;
    frmDesign.Font.Name := 'MS Sans Serif';
    frmDesign.Font.Style := [];
    frmDesign.Visible := True;
    frmDesign.PixelsPerInch := 96;
    Ok := TButton.Create(frmDesign);
    Ok.Parent := frmDesign;
    Ok.Left := 96;
    Ok.Top := 192;
    Ok.Width := 75;
    Ok.Height := 25;
    Ok.Caption := 'Ok';
    Ok.Font.Color := clWindowText;
    Ok.Font.Height := -11;
    Ok.Font.Name := 'Georgia';
    Ok.Font.Style := [];
    Ok.ParentFont := False;
    Ok.TabOrder := 9;
    Edit1 := TEdit.Create(frmDesign);
    Edit1.Parent := frmDesign;
    Edit1.Left := 72;
    Edit1.Top := 80;
    Edit1.Width := 121;
    Edit1.Height := 22;
    Edit1.Font.Color := clWindowText;
    Edit1.Font.Height := -11;
    Edit1.Font.Name := 'Georgia';
    Edit1.Font.Style := [];
    Edit1.ParentFont := False;
    Edit1.TabOrder := 10;
    Edit1.Text := 'Password';
    Username := TEdit.Create(frmDesign);
    Username.Parent := frmDesign;
    Username.Left := 72;
    Username.Top := 40;
    Username.Width := 121;
    Username.Height := 22;
    Username.Font.Color := clWindowText;
    Username.Font.Height := -11;
    Username.Font.Name := 'Georgia';
    Username.Font.Style := [];
    Username.ParentFont := False;
    Username.TabOrder := 11;
    Username.Text := 'Username';
    end;

    Procedure SafeInitForm;
    var
      v: TVariantArray;
    begin
      setarraylength(V, 0);
      ThreadSafeCall('InitForm', v);
    end;

    Procedure ShowFormModal;
    begin
      frmDesign.ShowModal;
    end;

    Procedure SafeShowFormModal;
    var
      v: TVariantArray;
    begin
      setarraylength(V, 0);
      ThreadSafeCall('ShowFormModal', v); //this line
    end;

    begin
      SetupSRL;
      SafeInitForm;
      SafeShowFormModal;
    end.

  2. #2
    Join Date
    Dec 2007
    Location
    192.168.1.73
    Posts
    2,439
    Mentioned
    6 Post(s)
    Quoted
    119 Post(s)

    Default

    Change this line:
    SCAR Code:
    frmDesign.Visible := True;

    To:
    SCAR Code:
    frmDesign.Visible := False;

  3. #3
    Join Date
    Dec 2006
    Location
    Copy pastin to my C#
    Posts
    3,788
    Mentioned
    8 Post(s)
    Quoted
    29 Post(s)

    Default

    frmDesign.Visible := True;
    I haven't even touched forms except for SRL Player Form for a long time, but I think that when I made a form for a powerminer of mine long time ago, I had to put that to False. Even it doesn't sound very logical, give it a go and tell how it went.

  4. #4
    Join Date
    Aug 2007
    Location
    Georgia, U.S.
    Posts
    890
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    thanks, that worked.

  5. #5
    Join Date
    Dec 2007
    Location
    192.168.1.73
    Posts
    2,439
    Mentioned
    6 Post(s)
    Quoted
    119 Post(s)

    Default

    np. You have to do that with all forms, i remember when I did forms to start with and I had no clue why it didn't work 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
  •