ben binevi not programı yapıyorum ve yeninot butonuna bastıkça aşağıdaki kodlarla formu create ediyorum.
Kod: Tümünü seç
procedure YeniFormOlustur;
Var
xxx : TForm;
begin
Inc(xFormNumarasi);
xxx := Tnotekle.Create(Application);
With xxx do
begin
Name := Format('Form_%.3d', [xFormNumarasi]);
Caption := Name;
Width := 212;
Height := 188;
Visible := True;
Left := xFormNumarasi*25;
Top := xFormNumarasi*25;
Tag := xFormNumarasi;
if j = 4 then j := 1 else j := j+1;
end;
end;
bende anaformun oncreate olayında dicemki eğer inide kayıtlı bir not varsa onu nasıl kaydettiysem öle ekrana getirsin.
yani leftini, topunu, memonun içindeki texti vs...ben biraz kod yazdım. anaformun oncreatine aşağıdaki kodları ekledim.
Kod: Tümünü seç
IF Mesaj[i].not_sayi<>0 Then
Begin
XFormNumarasi:=i;
xxx := Tnotekle.Create(Application);
With xxx do
begin
Name := Format('Form_%.3d', [xFormNumarasi]);
Caption := Name;
Width := Mesaj[i].f_Width;
Height := Mesaj[i].f_Height;
Left := Mesaj[i].f_Left;
Top := Mesaj[i].f_Top;
Tag := xFormNumarasi;
//if j = 4 then j := 1 else j := j+1;
For k:=0 To ComponentCount-1 do
if application.Components[k].name=Format('Form_%.3d', [xFormNumarasi]) then
begin
Tnotekle(application.Components[k]).Memo1.Text:=Mesaj[i].memo;
Tnotekle(application.Components[k]).header.LabelCaption:=mesaj[i].tarih;
//Tnotekle(application.Components[k]).alarm.Visible:=mesaj[i].alarm;
End;
end;
End;
Sorum kısaca formun ismi her defasında değiştiği için
....
Left := Mesaj.f_Left;
Top := Mesaj.f_Top;
memo1.text:= mesaj.memo;
.....
diyemiyorumya onu nasıl dicem???