Autor Beitrag
The...
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 122



BeitragVerfasst: Do 10.03.05 12:57 
hi,
also normal hat man ja nur form1, wo man denn ebend alles drauf macht!
ich brauche aber sowas das sich eine neue form (form2) öffnet wenn ich auf ein button klicke.
Sowas wie ein neues fenster!

schon mal danke...
1211chef
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 30

WIN XP Pro, Win 7-64bit Home
D4 Prof
BeitragVerfasst: Do 10.03.05 13:03 
dann klick hat auf den button (oben links) neues fenster und schreib in den button auf form1

form2.open;

_________________
Theorie: Alles läuft ... Praxis: Nix funzt ... Ich bin eben ein Mann der Praxis
opfer.der.genauigkeit
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 754
Erhaltene Danke: 1



BeitragVerfasst: Do 10.03.05 13:03 
Der Topictitel ist ziemlich aussagelos. :roll:

Aber zu deinem Problem:
Auf dem ersten Formular machst du mal zum Testen nen Button noch drauf und gehst in das OnClick - Event. (doppelklick auf den Button)

Leg über Datei -> Neu -> Formular
ein neues Formular an und dann kannst du das im Code so implementieren:

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:
unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

uses
  Unit2;


{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
  Frm: TForm2;
begin
  Frm := TForm2.Create( Self );
  Frm.ShowModal;
  Frm.Free;
end;

end.


//Edit: Achja, wenn du das zweite Formular eh über das Erste erstellst, wäre es sinnvoll wenn du unter Projekt -> Optionen -> Formulare aus dem
Bereich "Automatisch erzeugen" das zweite Formular in den Bereich "Verfügbare Formulare" verschiebst, da sonst dieses Formular beim Start
automatisch erzeugt wird. Wenn du das nicht entfernst würde dir das hier reichen:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
procedure TForm1.Button1Click(Sender: TObject);
begin
  Form2.ShowModal;
end;


Ist aber z.B. in großen Anwendungen ziemlich bescheiden..

_________________
Stellen Sie sich bitte Zirkusmusik vor.


Zuletzt bearbeitet von opfer.der.genauigkeit am Do 10.03.05 13:07, insgesamt 1-mal bearbeitet
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: Do 10.03.05 13:05 
user profile iconopfer.der.genauigkeit hat folgendes geschrieben:
Der Topictitel ist ziemlich aussagelos.


Deshalb würd ich den Ersteller des Topics bitten, ihn mit einem Klick auf den EDIT-Button zu ändern

AXMD
1211chef
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 30

WIN XP Pro, Win 7-64bit Home
D4 Prof
BeitragVerfasst: Do 10.03.05 13:07 
ach ja stimmt, heisst show oder showmodal, schäm, aber jetzt bringen wir ihn doch durcheinander

_________________
Theorie: Alles läuft ... Praxis: Nix funzt ... Ich bin eben ein Mann der Praxis
opfer.der.genauigkeit
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 754
Erhaltene Danke: 1



BeitragVerfasst: Do 10.03.05 13:08 
user profile icon1211chef hat folgendes geschrieben:
aber jetzt bringen wir ihn doch durcheinander


Wenn dem so ist, kann er ja nochmal dazu fragen stellen. :)

_________________
Stellen Sie sich bitte Zirkusmusik vor.
The... Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 122



BeitragVerfasst: Do 10.03.05 13:58 
cool... vielen, vielen dank :) :) :)

eine frage hätte ich da noch: also z.b. ich habe 'edit1' und 'label1' und 'timer1'!

so nun der code fürn timer :

ausblenden Delphi-Quelltext
1:
label1.caption:=edit1.text;					



so nun zeigt label1 immer den txt von edit1 an... aber ich brauche das so das es in der form2 auf
ein label erscheint?!

Wie geht das?
opfer.der.genauigkeit
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 754
Erhaltene Danke: 1



BeitragVerfasst: Do 10.03.05 14:58 
Erwartest du, daß ich dir dein Programm schreib. :wink:

Es gibt viele Möglichkeiten für dieses Problem.

a) Über Methoden (Funktionen/ Proceduren) und den entsprechenden Wert als Parameter übergeben.
b) Events
c) Properties

Setz dich mal mit der Delphi- Hilfe auseinander oder such im Forum, da ist dann der Lerneffekt höher, als
wenn du nur Code vorgesetzt bekommst.

_________________
Stellen Sie sich bitte Zirkusmusik vor.
The... Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 122



BeitragVerfasst: Do 10.03.05 15:47 
... nein nein, du sollst mir nicht mein prog. schreiben :D ! (Das würde auch sehr sehr lange duern!)

Also das ist das Programm wofür ich das brauchte (page3 der button 'über system tool' ):

System TOOL DOWNLOAD


okey... dann werde ich mich mal auf die suche machen!

und nochmal vielen dank...
opfer.der.genauigkeit
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 754
Erhaltene Danke: 1



BeitragVerfasst: Do 10.03.05 15:50 
Ich bin zu gutmütig. :lol:

Unit1:

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:
unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    Button1: TButton;
    Timer1: TTimer;
    Edit1: TEdit;
    procedure Button1Click(Sender: TObject);
    procedure Timer1Timer(Sender: TObject);
  private
    FForm2: TForm2;
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
  FForm2 := TForm2.Create( Self );
  Timer1.Enabled := true;
  FForm2.ShowModal;
  Timer1.Enabled := false;
  FForm2.Free;
end;

procedure TForm1.Timer1Timer(Sender: TObject);
begin
  FForm2.SetLabel( Edit1.Text );
  Edit1.Text := IntToStr( Random( 5 ) );
end;

end.


Unit2:

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:
unit Unit2;

interface

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

type
  TForm2 = class(TForm)
    Label1: TLabel;
  private
    { Private-Deklarationen }
  public
    procedure SetLabel(aText: string);
  end;

var
  Form2: TForm2;

implementation

{$R *.dfm}

{ TForm2 }

procedure TForm2.SetLabel(aText: string);
begin
  Label1.Caption := aText;
end;

end.

_________________
Stellen Sie sich bitte Zirkusmusik vor.