Autor Beitrag
darkdester
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 100



BeitragVerfasst: Sa 18.12.04 14:07 
hallo

habe mal wieder bissel was gecodet und habe jetzt einen fehler

ich habe form1 beim programmstart ausgeblendet mittels visible
und form3 eingeblendet

wenn cih dann form3 wegklicke soll form1 erscheinen
nur startet das programm gleich im fehler
hier sind die wichtigen sourcestücke

ausblenden Delphi-Quelltext
1:
2:
3:
4:
procedure TForm1.activ(Sender: TObject);
begin
Form1.Visible:=false;
Form3.Visible:=true;


ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
procedure TForm3.we(Sender: TObject);
begin
Form3.Close;
Form1.visible:=true;
end;



hab ich einen denkfehler oder warum geht das nicht?
danke für eure hilfe

mfg darkdester


edit: so heißt der fehler:
Eigenschaft Visible kann in OnShow oder OnHide nicht verändert werden.
AXMD
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: Sa 18.12.04 14:13 
Den Fehler hatte ich auch schon oft; die Fehlermeldung ist die Lösung: du kannst die Eigenschaft Visible deiner Form nicht im OnActive-Ereignis ändern; ich habs dann relativ unschön mit einem Timer gelöst...

AXMD
darkdester Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 100



BeitragVerfasst: Sa 18.12.04 14:16 
das geht nicht O.o

oh man dachte das geht -.-

na toll mit timer is doch voll umständlich

boahh -.-
AXMD
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: Sa 18.12.04 14:20 
Sooo schwer is es mit einem Timer dann auch wieder nicht; nur unschön.

Timer auf der Form platzieren; Enabled = false, Interval = 1

OnActivate
ausblenden Delphi-Quelltext
1:
Timer1.Enabled := true;					


OnTimer
ausblenden Delphi-Quelltext
1:
2:
Hide;
Timer1.Enabled := false;


;) AXMD
darkdester Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 100



BeitragVerfasst: Sa 18.12.04 14:22 
jo habs schon gelöst aber jetzt noch das andere prob

also er blendet FOrm1 weg und Form3 rein
allerdings zeigt er von FOrm3 nicht das bild an und nicht die umgebung darum

w8 uno minute ich mach screenie

edit: so siehts jetzt aus img151.exs.cx/my.php...;image=delphi5dm.jpg
manchmal sieht man selbst das weise drumherum nicht :cry:

der soll aber das bild anzeigen
Jelzin
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 30



BeitragVerfasst: Sa 18.12.04 14:28 
Ich habe das Problem bei einem "Intro-Fenster", das mir anzeigt wie weit der Initialisierungsfortschritt der Application ist anders gelöst (du musst dann deine project1.dpr bearbeiten):

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:
program MeineApplication;

uses
  Forms,
  MainUnit in 'MainUnit.pas' {FormMain},
  AboutUnit in 'AboutUnit.pas' {AboutBox},
  OptionenUnit in 'OptionenUnit.pas' {FormOptionen},
  IntroUnit in 'IntroUnit.pas' {FormIntro},
  Datamodule1Unit in 'Datamodule1Unit.pas' {DataModule1: TDataModule}
  // undsoweiter undsoweiter beim Unit-laden :)

{$R *.RES}

procedure ShowInfo(StatusInfo : string);

begin
  FormIntro.StatusBar.Panels[0].Text := StatusInfo;
  FormIntro.ProgressBar.StepIt; FormIntro.Update;
end;

begin
  Application.Initialize;
  FormIntro := TFormIntro.Create(Application);

  FormIntro.Show;
  FormIntro.ProgressBar.Max := 35;   // Anzahl der ShowInfo im weiteren Verlauf
  FormIntro.Update;

  Application.Title := 'Mein Application';

  ShowInfo('Datenmodul');
  Application.CreateForm(TDataModule1, DataModule1);
  Application.CreateForm(TFormMain, FormMain);
  ShowInfo('Main');
  ShowInfo('Hauptformulare');
  Application.CreateForm(TFormBibliothek, FormBibliothek); ShowInfo('Bibliothek');
  // und hier noch andere Formulare laden

  // Hauptfenster

  ShowInfo('Konfigurationsdatei lesen');
  FormMain.ReadIniFile;   // Hier lasse ich eine INI-File auslesen

  ShowInfo('Programmstart...');
  FormIntro.Hide;
  FormIntro.Free;

  FormMain.Visible := true;
  FormMain.OpenDatabase;  // Hier lasse ich meine Datenbank öffnen
  Application.Run;
end.


Vielleicht hilft dir das ja weiter.

Gruß

Jelzin
AXMD
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 4006
Erhaltene Danke: 7

Windows 10 64 bit
C# (Visual Studio 2019 Express)
BeitragVerfasst: Sa 18.12.04 14:29 
Bisschen mehr Code wär nicht schlecht ;)

AXMD

//EDIT: Hey, Jelzin, deine Idee is genial :shock:
darkdester Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 100



BeitragVerfasst: Sa 18.12.04 14:45 
mehr code ist nicht wichtig

die idee von jelzin check ich net ganz :?:

das is meien dpr datei
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
program Project1;

uses
  Forms,
  Unit1 in 'Unit1.pas' {Form1},
  Unit2 in 'Unit2.pas' {Form2},
  Unit3 in 'Unit3.pas' {Form3};

{$R *.res}

begin
  Application.Initialize;
  Application.CreateForm(TForm1, Form1);
  Application.CreateForm(TForm2, Form2);
  Application.CreateForm(TForm3, Form3);
  Application.Run;
end.


und jetzt O.o?

edit: plz leuzt help