Autor Beitrag
BigBossMan
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 32



BeitragVerfasst: Do 12.08.04 13:44 
Hallo Leute !

Habe noch ein kleines Problem.

Wie kann man eine dyn. Form beim Programmstart mit anzeigen ?

Beim Create Event des Hauptformulares geht es nicht, da bekomme ich eine Fehlermeldung.

Mfg

Moderiert von user profile iconTino: Topics zusammengeführen.
maxk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1696
Erhaltene Danke: 1

Win XP, Debian Lenny
Delphi 6 Personal
BeitragVerfasst: Do 12.08.04 13:54 
Was meinst du damit? TForm.Create?

_________________
Ein Computer wird das tun, was Du programmierst - nicht das, was Du willst.
BigBossMan Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 32



BeitragVerfasst: Do 12.08.04 14:03 
maxk hat folgendes geschrieben:
Was meinst du damit? TForm.Create?


Das habe ich im Hauptformular erstellt.

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:
procedure TFormMain.CreateEdForm(const AName: string);
begin
 Inc(num);
 edForm := TForm.Create(Application.MainForm);
 edForm.Top := 135;
 edForm.Height := 550;
 edForm.Width := 700;
 edForm.Left := 300;
 edForm.Name := 'edForm'+IntToStr(num);
 edForm.OnClose := FormClose;
 edForm.Visible := True;
 edForm.Caption := AName;

 sbar := TExtStatusBar.Create(edForm);
 sbar.Parent := edForm;
 sbar.Align := alBottom;
 sbar.AutoHint := True;
 sbar.SizeGrip := True;
 sbar.Panels.Insert(0);
 sbar.Panels.Items[0].Width := 250;
 sbar.Panels.Insert(1);
 sbar.Panels.Items[1].Width := 80;
 sbar.Panels.Items[1].Text := 'Z:  S: ';
 sbar.Panels.Items[1].Alignment := taCenter;
 sbar.Panels.Insert(2);
 sbar.Panels.Items[2].Width := 50;

 ed := TSynEdit.Create(edForm);
 ed.Parent := edForm;
 ed.Align := alClient;
 ed.Highlighter := gsyn;
 ed.SearchEngine := synfind;
 ed.OnStatusChange := edStatusChange;
 ed.OnChange := edChange;
 ed.Visible := True;

 edForm.Show;
 if FileExists(AName) then ed.Lines.LoadFromFile(AName);
 ed.SetFocus;
end;


Das möcht ich nun gleich beim Programmstart öffnen.

Moderiert von user profile iconTino: Code- durch Delphi-Tags ersetzt.
BigBossMan Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 32



BeitragVerfasst: Do 12.08.04 14:13 
Hat sich erledigt. Habe es so gemacht:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
program TWriter;

uses
  Forms,
  MainForm in 'MainForm.pas' {FormMain},
  oiform in 'oiform.pas' {FormObjView},
  objinsform in 'objinsform.pas' {FormInsp};

{$R *.res}

begin
  Application.Initialize;
  Application.CreateForm(TFormMain, FormMain);
  Application.CreateForm(TFormObjView, FormObjView);
  Application.CreateForm(TFormInsp, FormInsp);
  FormObjView.Show;
  FormInsp.Show;
  FormMain.CreateEdForm('Form'); -> dyn. Form
  Application.Run;
end.


Mfg

Moderiert von user profile iconTino: Code- durch Delphi-Tags ersetzt.
maxk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1696
Erhaltene Danke: 1

Win XP, Debian Lenny
Delphi 6 Personal
BeitragVerfasst: Do 12.08.04 14:20 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
// Muss wieder in die DPR!

Application.CreateForm(TFormMain,FormMain);
{Erstellen weiterer Formulare und Anzeigen mit Show}

FormMain.CreateEdForm(const AName: string); 
Application.Run;
Oder du führst CreateEdForm in FormCreate aus...

// Edit: Ich hätte schwören können, dass dein Beitrag vor meinem davor noch nicht da war :shock:

_________________
Ein Computer wird das tun, was Du programmierst - nicht das, was Du willst.