Autor Beitrag
CrazyLuke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 247

Windows XP Pro
Turbo Delphi Explorer, D2005 PE
BeitragVerfasst: Mo 28.03.05 13:23 
Hi!


Irgendwas ist grade bei der Einbindung der 2. Form schief gelaufen. Denn immer, wenn ich über die Schaltfläche "Optionen" die gleichnamige Form2 aufrufen möchte, erscheint folgende Fehlermeldung:

free.pages.at/djiltiz/delphi_form2.jpg

Was ist daran falsch, ich habs mit meinem anderen Programm verglichen, ich ahbe aber keine Unterschiede feststellen können.

Form1:
ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;

type
  TForm1 = class(TForm)
    GroupBox1: TGroupBox;
    GroupBox2: TGroupBox;
    StaticText1: TStaticText;
    StaticText2: TStaticText;
    Button1: TButton;
    Button2: TButton;
    Button3: TButton;
    Label1: TLabel;
    Label2: TLabel;
    procedure Button3Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form1: TForm1;

implementation

uses Unit2;

{$R *.dfm}

procedure TForm1.Button3Click(Sender: TObject);
begin
  Form2.Show;
end;

end.

Form2:
ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
unit Unit2;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, ComCtrls;

type
  TForm2 = class(TForm)
    PageControl1: TPageControl;
    TabSheet1: TTabSheet;
    GroupBox1: TGroupBox;
    CheckBox1: TCheckBox;
    GroupBox2: TGroupBox;
    CheckBox2: TCheckBox;
    CheckBox3: TCheckBox;
    CheckBox4: TCheckBox;
    Edit1: TEdit;
    Label1: TLabel;
    GroupBox3: TGroupBox;
    CheckBox5: TCheckBox;
    TabSheet2: TTabSheet;
    TabSheet3: TTabSheet;
    TabSheet4: TTabSheet;
    procedure Edit1KeyPress(Sender: TObject; var Key: Char);
    procedure CheckBox3Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form2: TForm2;

implementation

{$R *.dfm}

procedure TForm2.Edit1KeyPress(Sender: TObject; var Key: Char);
begin    
  if NOT (Key in [#08, '0'..'9']) then    
    Key := #0;
end;



procedure TForm2.CheckBox3Click(Sender: TObject);
begin
   Edit1.Enabled := CheckBox3.checked;
   Label1.Enabled := CheckBox3.checked;
end;

end.


Zuletzt bearbeitet von CrazyLuke am Mo 28.03.05 16:39, insgesamt 1-mal bearbeitet
raziel
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2453

Arch Linux
JS (WebStorm), C#, C++/CLI, C++ (VS2013)
BeitragVerfasst: Mo 28.03.05 13:32 
Ich vermute mal, dass Dein Form2 nicht automatisch erzeugt wird. Geh doch bitte mal auf "Projekt" -> "Optionen" auf den Tab "Formulare" und stelle sicher, dass Form2 in der Listbox unter "Automatisch erzeugen" drin ist. Alternativ kannst Du das Form2 auch dynamisch erzeugen, ist vielleicht sogar besser.

Gruß,
raziel

_________________
JSXGraph
CrazyLuke Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 247

Windows XP Pro
Turbo Delphi Explorer, D2005 PE
BeitragVerfasst: Mo 28.03.05 13:37 
Das wirds wohl sein, aber warum ist die dynamische Version besser und wie mach ich das?


Zum eigentlichen Problem:

Auto-create forms:
Form1

Available forms:
(nichts :!: )

MfG
CrazyLuke
CrazyLuke Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 247

Windows XP Pro
Turbo Delphi Explorer, D2005 PE
BeitragVerfasst: Mo 28.03.05 19:56 
Da das wohl anscheinend nicht so einfach geht, habe ich den Inhalt der nicht korrekt eingefügten Form kopiert und kopiert - allerdingsd in ein neues Projekt, das hat den Vorteil, dass ich die Optionen jetzt auch ohne das eigentliche Programm starten kann.

MfG
CrazyLuke