AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Konstantenobjekt ?

Ein Thema von Lotus · begonnen am 26. Jun 2007 · letzter Beitrag vom 26. Jun 2007
Antwort Antwort
Lotus

Registriert seit: 26. Feb 2007
85 Beiträge
 
Delphi 7 Personal
 
#1

Re: Globale Variable greift nicht zu?

  Alt 26. Jun 2007, 18:52
nein, e1 ist ein Edit fehlt, da gibts keine captions.. daran liegts leider nicht..

Hier vllt noch mal den gesammten Code
Delphi-Quellcode:
unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    e1: TEdit;
    e2: TEdit;
    Label1: TLabel;
    Label2: TLabel;
    Button1: TButton;
    Button2: TButton;
    Label3: TLabel;
    anzahl: TLabel;
    wort: TLabel;
    Button3: TButton;
    procedure Button3Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure Button2Click(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;
  wort:string;
  merker:integer;

implementation

{$R *.dfm}

procedure TForm1.Button3Click(Sender: TObject);
begin
close;
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
wort:=e1.Text;
Button1.Enabled:=false;
Button2.Enabled:=true;
e1.Text:='########';
e1.Enabled:=false;
e2.Enabled:=true;

end;

procedure TForm1.FormCreate(Sender: TObject);
begin
wort:='';
merker:=0;
end;

procedure TForm1.Button2Click(Sender: TObject);
var wort2:string;
begin
inc(merker);
showmessage(inttostr(merker));
wort2:=e2.Text;
showmessage(wort);
showmessage(wort2);
end;

end.
und die dfm
Delphi-Quellcode:
object Form1: TForm1
  Left = 188
  Top = 21
  Width = 786
  Height = 541
  Caption = 'Form1'
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'MS Sans Serif'
  Font.Style = []
  OldCreateOrder = False
  OnCreate = FormCreate
  PixelsPerInch = 96
  TextHeight = 13
  object Label1: TLabel
    Left = 32
    Top = 32
    Width = 38
    Height = 13
    Caption = 'Player 1'
  end
  object Label2: TLabel
    Left = 32
    Top = 64
    Width = 38
    Height = 13
    Caption = 'Player 2'
  end
  object Label3: TLabel
    Left = 16
    Top = 112
    Width = 35
    Height = 13
    Caption = 'Anzahl:'
  end
  object anzahl: TLabel
    Left = 72
    Top = 112
    Width = 3
    Height = 13
  end
  object wort: TLabel
    Left = 360
    Top = 64
    Width = 3
    Height = 13
  end
  object e1: TEdit
    Left = 96
    Top = 32
    Width = 121
    Height = 21
    TabOrder = 0
  end
  object e2: TEdit
    Left = 96
    Top = 64
    Width = 121
    Height = 21
    Enabled = False
    TabOrder = 1
  end
  object Button1: TButton
    Left = 232
    Top = 32
    Width = 89
    Height = 25
    Caption = 'Wort speichern'
    TabOrder = 2
    OnClick = Button1Click
  end
  object Button2: TButton
    Left = 232
    Top = 64
    Width = 89
    Height = 25
    Caption = 'Wort erraten'
    Enabled = False
    TabOrder = 3
    OnClick = Button2Click
  end
  object Button3: TButton
    Left = 528
    Top = 304
    Width = 75
    Height = 25
    Caption = 'Beenden'
    TabOrder = 4
    OnClick = Button3Click
  end
end
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 17:30 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz