This works just as expected:
var
Enum: TPair<string, TForm>;
MyDict: TDictionary<string, TForm>;
begin
MyDict := TDictionary<string, TForm>.Create;
try
MyDict.Add('Form1', Self);
for Enum in MyDict do
ShowMessage(Enum.Key);
finally
MyDict.Free;
end;
Paste this code in the FormCreate event of any form and see for yourself.
Fabio Gomes
2008-11-28 19:53:27