Autor Beitrag
5M17H
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 164

XP, Vista32, bald auch Vista64
PHP(3/5), Delphi(2), Java(1), C(3), C#(1)
BeitragVerfasst: Sa 30.09.06 17:57 
Hallo, ich wollte mal fragen: wie wechsle ich ein Form.

Meine idee: Eine Buttonfolge (z.B. Markt, zuHause, Kneipe) und wenn ich markt klicke, soll sich der aufbau des Form ändern von der startseite zu dem layout des MArkt.

Habe gefunden 'Datei > Neu > Formular'.
Habe da schon 2 neue gemacht, aber wie verbinde ich die?
Geht das auch mit frames? Obwohl die warschienlich ein shclechtere lösung sind.
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Sa 30.09.06 18:08 
In diesem fall könntest du auch ein PageControl nehmen, bei dem du die Tabs ausblendest.

_________________
Markus Kinzler.
5M17H Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 164

XP, Vista32, bald auch Vista64
PHP(3/5), Delphi(2), Java(1), C(3), C#(1)
BeitragVerfasst: Sa 30.09.06 18:18 
Der überdeckt alles.
Könntest du mir erklären wie ich damit Umgehe? Meine Delphihilfe ist im eimer... Warum auch immer.
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: Sa 30.09.06 18:22 
Die DF Hilfe funktioniert noch ! :D
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Sa 30.09.06 18:23 
Alle Komponenten ausschneiden ( außer PageControl), neue Tabs anlegen und die ausgeschnittenen Komponenten in der ersten Page einfügen. Auf der 2. page dann die des nächsten Bereichs. Die Pages haben die Eigenschaft .TabVisible mit denen man die Reiter ausblenden kann.

_________________
Markus Kinzler.


Zuletzt bearbeitet von mkinzler am Sa 30.09.06 18:25, insgesamt 1-mal bearbeitet
5M17H Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 164

XP, Vista32, bald auch Vista64
PHP(3/5), Delphi(2), Java(1), C(3), C#(1)
BeitragVerfasst: Sa 30.09.06 18:24 
Du meinst das Forum hier? Also DF = Delphi Forum?

Habe ncihts gefunden wo ich sehe wie ich das Anwende,
wenn ich PageControl in mein Form einfüge, überdeckt er alles.

Werde mal bei google.de suchen aber über antwroten freue ich mcih.

[edit]
Habe jetzt eine neue seite, aber er überdeckt alles von mienem alten form. Wie mache ich das 'sehbar'?
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Sa 30.09.06 18:29 
Sieh mal meinen Beitrag über deinem letzten ;-)

_________________
Markus Kinzler.
5M17H Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 164

XP, Vista32, bald auch Vista64
PHP(3/5), Delphi(2), Java(1), C(3), C#(1)
BeitragVerfasst: Sa 30.09.06 18:35 
Danke erstmal.
Habe alles gefunden.

Jetzt werde ich mich erstmal dazu verscuehn die tabs wechseln zu lassen, habe da shcon was im inet gefunden


melde mcih ncohmal
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Sa 30.09.06 18:38 
.ActivePage

_________________
Markus Kinzler.
5M17H Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 164

XP, Vista32, bald auch Vista64
PHP(3/5), Delphi(2), Java(1), C(3), C#(1)
BeitragVerfasst: Sa 30.09.06 18:39 
xD. Habe gesagt:
5M17H hat folgendes geschrieben:

Jetzt werde ich mich erstmal dazu verscuehn die tabs wechseln zu lassen, habe da shcon was im inet gefunden


Aber egal, danke für die Hilfe.
Problem. Ich starte das Programm, und es kommt erstmal alles. Aber ich kann nichts benutzen. Warum?

4x label
2x edit
2x button
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Sa 30.09.06 18:42 
Bist du dir sicher, daß du die Komponenten in die Pages eingefügt hast.

_________________
Markus Kinzler.
5M17H Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 164

XP, Vista32, bald auch Vista64
PHP(3/5), Delphi(2), Java(1), C(3), C#(1)
BeitragVerfasst: Sa 30.09.06 18:46 
Ja die auflistung "Struktur" sieht so aus

  • Lebenssimulation(PageControl1)
  • +Einloggen(Seite 1)
  • -label1
  • -abel2
  • -edit1
  • -label3
  • -edit2
  • -Button1
  • -Button2
  • -label4
  • +Seite2 (Seite 2)
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Sa 30.09.06 18:51 
Post mal das Programm, dann schau ich es mir mal an.

_________________
Markus Kinzler.
5M17H Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 164

XP, Vista32, bald auch Vista64
PHP(3/5), Delphi(2), Java(1), C(3), C#(1)
BeitragVerfasst: Sa 30.09.06 18:57 
Ja im anhang

[edit]
meintest du
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:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
unit main;

interface

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

type
  TForm1 = class(TForm)
    Lebenssimulation: TPageControl;
    Einloggen: TTabSheet;
    Label1: TLabel;
    Label2: TLabel;
    Edit1: TEdit;
    Label3: TLabel;
    Edit2: TEdit;
    Button1: TButton;
    Button2: TButton;
    Label4: TLabel;
    Seite2: TTabSheet;
    procedure Button1Click(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    name : string;
    alter : integer;
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button2Click(Sender: TObject);
var f : TextFile;
    datei_name, ausgabe : string;
begin
  datei_name := 'C:\'+edit1.text+'.txt';
  if not (FileExists('C:\'+datei_name)) then
  begin
    AssignFile(f,datei_name);
    Rewrite(f);
    Writeln(f,edit1.text);
    Writeln(f,edit2.text);
    Reset(f);
    ausgabe := 'Kreation war erfolgreich! Bitte einloggen.';
    label4.Caption := ausgabe;
  end;
end;

procedure TForm1.Button1Click(Sender: TObject);
var f : TextFile;
  datei_name : string;
  i : integer;
  zeile : array of string;
begin
  if (edit1.Text = '') or (edit2.text = '') then
    label4.Caption := 'Bitte kontacktdaten eingeben'
  else
  begin
    i := 0;
    datei_name := 'C:\'+edit1.text+'.txt';
    AssignFile(f,datei_name);
    Reset(f);
    while not EOF(f) do
    begin
      inc(i);
      ReadLn(f, zeile[i]);
    end;
    name := zeile[1];
    alter := integer(zeile[2]);
    Lebenssimulation.ActivePage:= Lebenssimulation.Pages[2];
  end;
end;

end.
Einloggen, um Attachments anzusehen!
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Sa 30.09.06 19:41 
Ich habe den PageControl noch mal gelöscht und neu erzeugt, nun geht es.

_________________
Markus Kinzler.
5M17H Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 164

XP, Vista32, bald auch Vista64
PHP(3/5), Delphi(2), Java(1), C(3), C#(1)
BeitragVerfasst: So 01.10.06 19:18 
Quasi das ganze pagecotrol und dann ncohmal alle edits und co neu rein?

Also alles neu auser code ja?


Bei mir at home ist inet im *popo* son scheiß.

[edit]
So jetzt gehts.

Allerdings:
ich habe ja
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
if not (FileExists('C:\'+datei_name)) then
  begin
  AssignFile(f,datei_name);
  Rewrite(f);
  Writeln(f,edit1.text);
  Writeln(f,edit2.text);
  Reset(f);
  ausgabe := 'Kreation war erfolgreich! Bitte einloggen.';
  label4.Caption := ausgabe;
end;

jetzt möchte ich prüfen ob f leer ist. Wie mache ich das?
ausblenden Delphi-Quelltext
1:
2:
if not f = '' then
  Reset(f);

geht nciht.

[edit2]
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
procedure TForm1.Button3Click(Sender: TObject);
var f, a, b : TextFile;
    datei_pfad : string;
begin
  if not (edit3.text = '') or
  (edit4.text = '') or
  (edit5.text = '') then
  begin
    if not FileExists('./Settings.txt') then
      AssignFile(b, './Settings.txt');
    datei_pfad := edit5.Text+edit3.text+'.cfg';
    AssignFile(f, datei_pfad);
    Rewrite(f);
    Writeln(f, edit3.text);
    Writeln(f, edit4.text);
    Reset(f);
    AssignFile(a, './Settings.txt');
    Rewrite(a);
    Writeln(a, datei_pfad);
    label9.caption := 'Jau haut hin. Saved in:'+datei_pfad;
  end;
end;

Wieso schreibt er in Settings.txt nciht den pfad rein? Kreiren tut ers, aber er schreibt nichts rein.
5M17H Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 164

XP, Vista32, bald auch Vista64
PHP(3/5), Delphi(2), Java(1), C(3), C#(1)
BeitragVerfasst: Mo 02.10.06 20:55 
kann mir keiner helfen?

Er soll im oben genannten Quellcode folgendes machen:
1. überprüfen ob alle felder leer sind, wenn nicht weiter.
2. Wenn file 'settings.txt' nciht existiert soll ers erstellen.
3. dateipfad zusammensetzen
4. datei erstellen, und 2 zeilen rienschreiben
5. file Settings.txt öffnen
6. neue zeile einfügen wo nur der dateipfad steht.

wenn das klappt kann ich weitermachen, forher bringt alles weitere recht wenig, kanns ja nciht testen.
mkinzler
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 4106
Erhaltene Danke: 13


Delphi 2010 Pro; Delphi.Prism 2011 pro
BeitragVerfasst: Mo 02.10.06 21:05 
-Warum nimmst du keine Ini-File?
-Rewrite löscht die Datei, hier wäre wohl Append besser

_________________
Markus Kinzler.
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: Mo 02.10.06 23:27 
@ 5M17H Hallo !
Versteh das jetzt nicht falsch, aber Dir wurde schon in einigen Threads vorgeschlagen Dich mal mit den Grundlagen von Delphi zu beschäftigen.
Wenn man Deine Fragen so anschaut, scheint es so als ob Du nicht so sehr interessiert wärst was zu lernen, sondern eher auf fertige Lösungen stehst.

_________________
Blackheart666
Der Irrsinn ist bei Einzelnen etwas Seltenes, - aber bei Gruppen, Parteien, Völkern, Zeiten die Regel. (Friedrich Nietzsche)
5M17H Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 164

XP, Vista32, bald auch Vista64
PHP(3/5), Delphi(2), Java(1), C(3), C#(1)
BeitragVerfasst: Fr 06.10.06 19:36 
sry inet war im *popo*.

Nuja,
nein ich suche keine lösung. Nur in der Delphi hilfe stand ncihts verständliches, und inet war wie gesagt kaputt.
Wenns nen thema dazu in diesem forum gibt, gebt mir nen link, habe shcon gesucht.
Ich habe auch bei google.de gesucht.
Es gab nirgends mein problem.

[edit]
also: in settings.txt schreibt er schon rein aber er überschreibt eine zeile, wenn eine drinnsteht.