BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Save, Restore position of docked form!

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi VCL Components Using
View previous topic :: View next topic  
Author Message
Muhammad Mamouri
Guest





PostPosted: Thu Aug 24, 2006 7:38 pm    Post subject: Save, Restore position of docked form! Reply with quote



Hi

I want to save, restore positons of docked form. I have a panel named
pnlDockedForm and I dock Form2 and Form3 into this panel at OnCreate
event of my main form.

Now I want to save, restore position of these forms. There are two
methods (LoadFromStream and SaveToStream) in IDockInterface that sould
work for this problem. but they don't work.

Here is a function that I use form Loading layout:
procedure LoadLayout;
var
AStream: TMemoryStream;
begin
if not FileExists(ExtractFilePath(Application.ExeName) +
'Layout.dat') then Exit;
AStream := TMemoryStream.Create;
try
AStream.LoadFromFile(ExtractFilePath(Application.ExeName) +
'Layout.dat');
AStream.Position := 0;
ScrollBox1.DockManager.LoadFromStream(AStream);
finally
AStream.Free;
end;
end;

And here is the function that I use for saving the layout:
procedure SaveLayout;
var
AStream: TMemoryStream;
begin
AStream := TMemoryStream.Create;
try
ScrollBox1.DockManager.SaveToStream(AStream);
AStream.Position := 0;
AStream.SaveToFile(ExtractFilePath(Application.ExeName) +
'Layout.dat');

finally
AStream.Free;
end;
end;

Does somebody know why these two methods are not working?

Regards
Back to top
Riki Wiki
Guest





PostPosted: Sat Aug 26, 2006 11:28 am    Post subject: Re: Save, Restore position of docked form! Reply with quote



Hoi

You need to repost your question on the Borland news server to make
everybody see it and possibly answer your question. Further, this news
group do not officially exist, the group to use is
b.p.d.vcl.components.using.win32.

How to post to Delphi newsgroups:
<http://delphi.wikia.com/wiki/Delphi_Newsgroups>
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi VCL Components Using All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.