Autor Beitrag
maniac_89
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 54



BeitragVerfasst: So 26.06.05 11:38 
Hallo,
ich hab ein Problem und zwar möchte ich eine Hauptform verdecken. Hier der Quelltext:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
  if reg[2] = 'Regist' then
  begin
      Form1 := TForm1.Create(Self);
      form1.show;
      form2.hide;
  end;

// Das steht dan bei Form2.create

-------


Das Problem ist das auch wenn in der Datei der text "Regist" steht, bleibt troztdem Form2(Hauptform) offen bzw. sichtbar. Wie kann ich das Problem lösen :?: .

Steffen, Maniac_89

Moderiert von user profile iconraziel: Delphi-Tags hinzugefügt.
Moderiert von user profile iconTino: Topic aus Sonstiges verschoben am Mi 29.06.2005 um 09:40
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: So 26.06.05 11:42 
ausblenden Delphi-Quelltext
1:
Form2.Visible := False					

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
maniac_89 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 54



BeitragVerfasst: So 26.06.05 11:47 
Und was macht das genau und wo soll ich es einsetzten

Steffen, Maniac_89
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: So 26.06.05 11:58 
ausblenden OnForm2Create
1:
2:
3:
4:
5:
6:
if reg[2] = 'Regist' then 
begin 
  Form1 := TForm1.Create(Self); 
  Form1.Show;
  Form2.Visible := False;
end;


Visible = Sichtbar
Guck mal in der OnlineHilfe nach.

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
maniac_89 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 54



BeitragVerfasst: So 26.06.05 12:03 
Geht immer noch nicht, die Form2 ist immer noch offen
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: So 26.06.05 12:07 
Dann ist if reg[2] = 'regist' then = False.
Guck mal ob reg[2] korrekt ist.
Also mal mit ShowMessage anzeigen lassen.

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
maniac_89 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 54



BeitragVerfasst: So 26.06.05 12:15 
ne, ich hab alles überprüft müsste eigentlich funktionieren
chrissivo
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 130

WIN XP, WIN 2000, WIN MCE, WIN 98
D5 Pers
BeitragVerfasst: So 26.06.05 12:42 
Dass sich nichts ändert, ist klar, schließlich macht Hide nichts anderes als die Eigenschaft Visible auf false zu setzen. Steht im Übrigen auch in der Hilfe.
Habe es bei mir auch probiert, geht aber nicht. Visible steht außerdem von Anfang an auf false, da ein jedes Formular, wenn man es nicht im Quelltext des Projekts geändert hat, mit dem Start erzeugt wird.
Mit Show, scheint man die Eigenschaft dann auf true zu setzen.
Ich würde es an deiner Stelle mal mit Close versuchen. Du musst aber aufpassen, wenn du dein Hauptformular schließt, ist die ganze Anwendung beendet.
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: So 26.06.05 12:51 
Bei mir funktionierts aber.

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
chrissivo
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 130

WIN XP, WIN 2000, WIN MCE, WIN 98
D5 Pers
BeitragVerfasst: So 26.06.05 13:00 
Könnte das evtl. ein Problem der Delphi Version sein???
Ich habs mit Hide mit Visible und mit beidem probiert, ging nicht.
Ich muss dazu sagen, dass ich versucht habe, dass aufs Form2 anzuwenden. Macht das einen Unterschied, auf welches Form man das anwendet?

Chrissi
jakobwenzel
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1889
Erhaltene Danke: 1

XP home, ubuntu
BDS 2006 Prof
BeitragVerfasst: Mi 29.06.05 17:10 
Guck mal, ob die if-Bedingung korrekt aufgefufen wird, indem du ein Beep; reipackst.
chrissivo
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 130

WIN XP, WIN 2000, WIN MCE, WIN 98
D5 Pers
BeitragVerfasst: Mo 04.07.05 10:52 
@jakobmenzel: Ja, ich habe es mit Breakpoint einem Breakpoint gemacht. Ist auf korrekt in die Anweisung reingegangen. Weiß nicht, warum das nicht geht...