Bir tane mdiformum var FAna bitane unit im var ismi mainprocesses form değil unit. birden fazlada avaible formum var. mainprocesses deki procedure şu şekilde.
Kod: Tümünü seç
Procedure FormAc(Form:TForm; FormTip:TFormClass; FormTag:Integer; En:Integer; Boy:Integer);
var
chlcnt : integer;
QU : TUniQuery;
Begin
QU := TUniQuery.Create(nil);
With QU do
begin
Connection := Dm.AsCon;
Close;
SQL.Clear;
SQL.Add('SELECT GORME FROM TBLUSERSD');
SQL.Add('WHERE (USERSMID='+QuotedStr(inttostr(FAna.userid))+') AND (TBLFORMSID='+QuotedStr(inttostr(formtag))+')');
Open;
end;
if QU.FieldByName('GORME').AsString = '1' then
begin
if Assigned(Form) then
Form.BringToFront
else
Begin
Form := FormTip.Create(nil);
with Form do
begin
if FormStyle = fsNormal Then
FormStyle := fsMDIChild;
Width := en;
Height := boy;
chlcnt := FAna.MDIChildCount;
left := chlcnt*10;
top := chlcnt*10;
Fana.TcAutoService.Tabs.Add(Caption);
Fana.TcAutoService.TabIndex := Fana.TcAutoService.Tabs.Count-1;
end;
end;
end
else
Application.MessageBox('UYARI : Bu Pencereyi Görüntüleme Yetkiniz Yok.',
'UYARI',
MB_OK+
MB_ICONEXCLAMATION+
MB_DEFBUTTON1+
MB_SYSTEMMODAL);
FreeAndNil(QU);
End;
FormAc(FAracCinsList, TFAracCinsList, 2031, 870, 450);
şimdi ben bu işlemi daha önce aşağıdaki şekilde butonların içerisine yazıyordum sorunsuz çalışıyordu.
Kod: Tümünü seç
if Assigned(FAracCinsList) then
FAracCinsList.BringToFront
else
Begin
FAracCinsList := TFAracCinsList.Create(self);
with FAracCinsList do
begin
if FormStyle = fsNormal Then
FormStyle := fsMDIChild;
Width := 870;
Height := 450;
chlcnt := FAna.MDIChildCount;
left := chlcnt*10;
top := chlcnt*10;
TcAutoService.Tabs.Add(Caption);
TcAutoService.TabIndex := TcAutoService.Tabs.Count-1;
end;
End;
açtığım formun içerisine bi buton koyuyorum showmessage(FAracCinsList.caption) diyorum boş geliyor. bi yerde hata var ama nerede bulamadım. yardımcı olursanız çok sevinirim.