Page 1 of 1

Smooth sliding of form..

PostPosted: March 29th, 2007, 10:55 pm
by Codius
I'm trying to make a part of my form slide out when I press a button..

Code: Select all
for i := 0 to 200 do
begin
  frMain.Width := frMain.Width + 2;
end;


The problem is that this really doesn't look good, I've tried to create a couple of threads which would all do that.. but it doesn't work either. Anyone got an idea how to fix this?

PostPosted: March 30th, 2007, 2:01 pm
by Johnny_Bit
Double buffered to true, process messages on each iteration. shoud work fine

PostPosted: March 30th, 2007, 5:18 pm
by Codius
Well it's certainly an improvement, but still objects such as labels which are aligned to something will flicken like crazy

PostPosted: March 30th, 2007, 10:08 pm
by Kambiz
Instead of placing controls on the form, place them on a panel and set panel's DoubleBuffered property to True. Also, after each iteration call TPanel.Update method.

PostPosted: March 31st, 2007, 10:52 am
by Codius
thanks alot, the problem was that I had everything in panels already, but I didn't set the panels to doublebuffered.