maalesef olmadı
[Error] Unit2.pas(80): Incompatible types
hata satırı
--> if componentCount = Components[ie] Then <---
kodları temize aldım yazıyorum
Kod: Tümünü seç
unit Unit2;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls,clipbrd,ExtCtrls;
type
TForm2 = class(TForm)
ComboBox1: TComboBox;
ComboBox2: TComboBox;
Panel1: TPanel;
Button1: TButton;
procedure ComboBox2Change(Sender: TObject);
procedure Button1Click(Sender: TObject);
private
procedure Edit_Uret;
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
x:array[1..30]of Tedit;
i:integer;
implementation
uses
unit1;
{$R *.dfm}
//--------------PROCEDURE------Edıt--create------------
procedure TForm2.Edit_Uret;
var
ia:integer;
Begin
for ia:=ComboBox1.ItemIndex to ComboBox2.ItemIndex do
Begin
x[ia]:=TEdit.Create(Self);
x[ia].Left:=2;
x[ia].Top:=(ia-0)*20;
x[ia].Width:=160;
x[ia].Height:=20;
x[ia].Cursor:=crDefault;
x[ia].Parent:=Panel1;
x[ia].Text:='Alan Adı '+IntToStr(ia);
x[ia].Name:='Edit'+IntToStr(ia);
end;
end;
//-----ADET--SEC--//-CREATE--EDIT----------
procedure TForm2.ComboBox2Change(Sender: TObject);
var
i:integer;
begin
if (ComboBox1.ItemIndex=-1)then
begin
ShowMessage('baslama limiti seciniz');
end
else
begin
for i:= 0 to ComponentCount -1 do
BEgin
//ComboBox 2. kez secilirse
if Components[i] is Tedit then
with Tedit(Components[i]) do begin
//hide; //gizle ok
//free; //eskiyi yok et yok et ---hata var (-1-)
Name:=''; //yeniden adlandır ok
end;
end;
Edit_Uret;
end;
end;
//---------------KAYIT------------------------------
procedure TForm2.Button1Click(Sender: TObject);
var
ie:integer;
begin
for ie:= 0 to ComponentCount -1 do
begin
if Components[ie] is Tedit then
with Tedit(Components[ie]) do begin
if componentCount = Components[ie] Then
begin
ClipBoard.SetTextBuf(PChar(name+ #13 ));
break;
end;
ClipBoard.SetTextBuf(PChar(name+','+ #13 ));
Form1.RichEdit1.PasteFromClipboard;
end;
end;
end;
//---------------------------------------------
end.
ayrıca ilgine tesekkür ederim
sevgiler