AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Sprachen und Entwicklungsumgebungen Sonstige Fragen zu Delphi Delphi fehlermeldung bei combobox! bitte um hilfe
Thema durchsuchen
Ansicht
Themen-Optionen

fehlermeldung bei combobox! bitte um hilfe

Ein Thema von jordan93 · begonnen am 2. Nov 2010 · letzter Beitrag vom 2. Nov 2010
 
jordan93

Registriert seit: 2. Nov 2010
12 Beiträge
 
#9

AW: fehlermeldung bei combobox! bitte um hilfe

  Alt 2. Nov 2010, 19:34
Delphi-Quellcode:
unit Unit1;

interface

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

type
  TForm1 = class(TForm)
    Button1: TButton;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Label6: TLabel;
    Label1: TLabel;
    Button2: TButton;
    Label7: TLabel;
    Label8: TLabel;
    ComboBox1: TComboBox;
    procedure Button2Click(Sender: TObject);
    procedure Button1Click(Sender: TObject);

  private
    { Private declarations }
  public
    { Public declarations }

  end;

var
  Form1: TForm1;
  heer: integer;
  zahl: integer;

implementation

{$R *.dfm}

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

procedure TForm1.Button1Click(Sender: TObject);
begin
heer:=1000;
randomize;
zahl:= random(6)+1;

if zahl= 1 then Label7.Caption:='1';
if zahl= 2 then label7.Caption:='2';
if zahl= 3 then label7.caption:='3';
if zahl= 4 then label7.caption:='4';
if zahl= 5 then label7.caption:='5';
if zahl= 6 then label7.Caption:='6';
Label7.Caption:= inttostr(zahl);

if zahl= 1 then label1.visible:=true;
if zahl= 2 then label2.Visible:=true;
if zahl= 3 then label3.Visible:=true;
if zahl= 4 then label4.Visible:=true;
if zahl= 5 then label5.Visible:=true;
if zahl= 6 then label6.Visible:=true;

if zahl= 1 then label2.Visible:=false;
if zahl= 1 then label3.Visible:=false;
if zahl= 1 then label4.Visible:=false;
if zahl= 1 then label5.Visible:=false;
if zahl= 1 then label6.Visible:=false;

if zahl= 2 then label1.Visible:=false;
if zahl= 2 then label3.visible:=false;
if zahl= 2 then label4.Visible:=false;
if zahl= 2 then label5.Visible:=false;
if zahl= 2 then label6.Visible:=false;

if zahl= 3 then label1.Visible:=false;
if zahl= 3 then label2.Visible:=false;
if zahl= 3 then label4.visible:=false;
if zahl= 3 then label5.visible:=false;
if zahl= 3 then label6.Visible:=false;

if zahl= 4 then label1.Visible:=false;
if zahl= 4 then label2.visible:=false;
if zahl= 4 then label3.Visible:=false;
if zahl= 4 then label5.Visible:=false;
if zahl= 4 then label6.Visible:=false;

if zahl= 5 then label1.visible:=false;
if zahl= 5 then label2.Visible:=false;
if zahl= 5 then label3.Visible:=false;
if zahl= 5 then label4.Visible:=false;
if zahl= 5 then label6.Visible:=false;

if zahl= 6 then label1.visible:=false;
if zahl= 6 then label2.visible:=false;
if zahl= 6 then label3.Visible:=false;
if zahl= 6 then label4.Visible:=false;
if zahl= 6 then label5.Visible:=false;

if zahl= 1 then label1.Caption:='SCHLACHT DEUTLICH VERLOREN !!! du hast viele kämpfer verloren, da du viel zu unüberlegt agiert hast!!';
if zahl= 2 then label2.Caption:='SCHLACHT VERLOREN!!! du solltest das nächste mal taktischer vorgehen. viele kämpfer hast du jetzt verloren!!!';
if zahl= 3 then label3.caption:='SCHLACHT KNAPP VERLOREN!!! gut gekämpft. aber etwas unüberlegt!!!';
if zahl= 4 then label4.Caption:='SCHLACHT SEHR KNAPP VERLOREN!!! du hast sehr gut gekämpft, aber leider hat dir das nötige glück gefehlt!!!';
if zahl= 5 then label5.caption:='UNENTSCHIEDEN!!! gut gemacht. immerhin noch ein unentschieden erkämpft!!';
if zahl= 6 then label6.caption:='SCHLACHT GEWONNEN!!! du bist der beste!!!';

if zahl= 1 then label8.Caption:=floattostr(heer-500);
if zahl= 2 then label8.caption:=floattostr(heer-400);
if zahl= 3 then label8.caption:=floattostr(heer-300);
if zahl= 4 then label8.Caption:=floattostr(heer-200);
if zahl= 5 then label8.caption:=floattostr(heer-100);
if zahl= 6 then label8.caption:=floattostr(heer+500);

if zahl= 6 then showmessage('ende! du hast gewonnen!');

end;

Geändert von mkinzler ( 2. Nov 2010 um 19:39 Uhr) Grund: Delphi-Tag eingefügt
  Mit Zitat antworten Zitat
 


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 23:55 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