editleri ve butonları yerleştirip dizaynı kurduktan sonra programı calıştırıp bakarsanız eksiklik olduğunu goreceksiniz yardımcı olursanız sevinirim ve edit in icinde sectiğimiz her sayı sıralanacak kucukten buyuğe mesela 45 sectim sonra 4 sectim sonra 33 sectim sıralama 4-33-45 olarak devam edicek.ve 6 tane sayıyı sectiğim zaman silmek istersem sildiğim ilk numara ve sectiklerimin dışındaki numaralar aktif olmalı.bana yardım edersiniz sevinirim
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, Buttons, ActnList, StdActns, jpeg, ExtCtrls;
type
TForm1 = class(TForm)
SpeedButton1: TSpeedButton;
SpeedButton2: TSpeedButton;
SpeedButton3: TSpeedButton;
SpeedButton4: TSpeedButton;
SpeedButton8: TSpeedButton;
SpeedButton9: TSpeedButton;
SpeedButton10: TSpeedButton;
SpeedButton11: TSpeedButton;
SpeedButton15: TSpeedButton;
SpeedButton16: TSpeedButton;
SpeedButton17: TSpeedButton;
SpeedButton18: TSpeedButton;
SpeedButton22: TSpeedButton;
SpeedButton23: TSpeedButton;
SpeedButton24: TSpeedButton;
SpeedButton25: TSpeedButton;
SpeedButton29: TSpeedButton;
SpeedButton30: TSpeedButton;
SpeedButton31: TSpeedButton;
SpeedButton32: TSpeedButton;
SpeedButton36: TSpeedButton;
SpeedButton37: TSpeedButton;
SpeedButton38: TSpeedButton;
SpeedButton39: TSpeedButton;
SpeedButton43: TSpeedButton;
SpeedButton44: TSpeedButton;
SpeedButton45: TSpeedButton;
SpeedButton46: TSpeedButton;
SpeedButton5: TSpeedButton;
SpeedButton6: TSpeedButton;
SpeedButton7: TSpeedButton;
SpeedButton12: TSpeedButton;
SpeedButton13: TSpeedButton;
SpeedButton14: TSpeedButton;
SpeedButton19: TSpeedButton;
SpeedButton20: TSpeedButton;
SpeedButton21: TSpeedButton;
SpeedButton26: TSpeedButton;
SpeedButton27: TSpeedButton;
SpeedButton28: TSpeedButton;
SpeedButton33: TSpeedButton;
SpeedButton34: TSpeedButton;
SpeedButton35: TSpeedButton;
SpeedButton40: TSpeedButton;
SpeedButton41: TSpeedButton;
SpeedButton42: TSpeedButton;
SpeedButton47: TSpeedButton;
SpeedButton48: TSpeedButton;
SpeedButton49: TSpeedButton;
Edit1: TEdit;
SpeedButton50: TSpeedButton;
Edit2: TEdit;
Edit3: TEdit;
Edit4: TEdit;
Edit5: TEdit;
Edit6: TEdit;
Edit7: TEdit;
Button1: TButton;
Button2: TButton;
Button3: TButton;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Timer1: TTimer;
procedure SpeedButton37Click(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure SpeedButton50Click(Sender: TObject);
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
procedure Button3Click(Sender: TObject);
procedure Timer1Timer(Sender: TObject);
private
public
end;
var
Form1: TForm1;
xx,i,a:integer;
d:array[1..6] of string;
implementation
procedure TForm1.SpeedButton37Click(Sender: TObject);
var
x:string;
begin
a:=a+1;
edit1.Text:=edit1.Text[sender as tspeedbutton).Caption+'-';
d[a]:=(sender as tspeedbutton).Caption+'-';
x:=(sender as tspeedbutton).Caption;
tspeedbutton(FindComponent('speedbutton'+x)).Enabl ed:=false;
if a=6 then
begin
for i:=1 to 49 do
TSpeedButton(FindComponent('speedbutton'+inttostr( i))).Enabled:=false;
showmessage ('6 RAKAM SECTİNİZ')
end;
xx:=6;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
a:=0;
timer1.Interval:=250;
caption:='SAYISAL LOTO';
end;
procedure TForm1.SpeedButton50Click(Sender: TObject);
var
cc:string;
begin
edit1.Clear;
cc:=d[xx];
xx:=xx-1;
for i:=1 to xx do
begin
edit1.Text:=edit1.Text+d[i];
end;
delete(cc,length(cc),1);
tspeedbutton(FindComponent('speedbutton'+cc)).Enab led:=true;
end;
procedure TForm1.Button1Click(Sender: TObject);
var
a:array [1..6] of integer;
b,c,d:integer;
g:boolean;
begin
randomize;
for b:=1 to 6 do
a[b]:=random(48]1;
b:=0;
repeat
g:=true;
for b:=1 to 5 do
if a[b]>a[b+1] then
begin
c:=a[b];
a[b]:=a[b+1];
a[b+1]:=c;
g:=false;
end
else
if a[b]=a[b+1] then
begin
a[b]:=random(48]1;
g:=false;
end;
until g=true;
edit2.Text:=inttostr(a[1]);
edit3.Text:=inttostr(a[2]);
edit4.Text:=inttostr(a[3]);
edit5.Text:=inttostr(a[4]);
edit6.Text:=inttostr(a[5]);
edit7.Text:=inttostr(a[6]);
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
showmessage('xxxxxxxxxxxxxxxxxxxxxx');
end;
procedure TForm1.Button3Click(Sender: TObject);
begin
close;
end;
procedure TForm1.Timer1Timer(Sender: TObject);
begin
label7.caption:='Tarih '+datetostr(date] ' Saat '+ timetostr(time);
caption:=copy(caption,2,length(caption)-1]caption[1];
end;
end.
__________________
kodlarda eksiklik var tmm lamam icin yardımcı olurmusunuz???
Programlama0 Mesaj
●31 Görüntüleme
- ReadBull.net
- Programlama ve Yazılım
- Programlama
- kodlarda eksiklik var tmm lamam icin yardımcı olurmusunuz???