Hi Stahli
Ein ShowMessage:
Zitat:
[Window Title]
Terminkalenderproject
[Content]
FDayNumberFrame.Width := 260
AParentCtrl.Width := 1314
AParentCtrl.ClientWidth := 1314
Widthtotal := 1560
FDayNumberFrame.Width := 260
GetParentControlPostion := -246
[OK]
und wie es zustande kommt:
Delphi-Quellcode:
function TPnlCalendarFrame.GetParentControlPostion(AParentCtrl : TPanel): integer;
var Widthtotal : Word;
begin
Widthtotal := (6 * FDayNumberFrame.Width);
Result := (AParentCtrl.ClientWidth - Widthtotal);
ShowMessage('FDayNumberFrame.Width := ' + InttoStr(FDayNumberFrame.Width) + slinebreak+
'AParentCtrl.Width := ' + InttoStr(AParentCtrl.Width) + slinebreak+
'AParentCtrl.ClientWidth := ' + InttoStr(AParentCtrl.ClientWidth) + slinebreak+
'Widthtotal := ' + InttoStr(Widthtotal) + slinebreak+
'FDayNumberFrame.Width := ' + InttoStr(FDayNumberFrame.Width) + slinebreak+
'GetParentControlPostion := ' + InttoStr(Result));
end;
Hochinteressant dabei: Zeile2 und 3 aus der ShowMessage-Anweisung.
Gruss
Delbor