Smooth sliding of form..

Please discuss general Delphi programming topics here.

Smooth sliding of form..

Postby Codius » March 29th, 2007, 10:55 pm

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?
I've never let my schooling interfere with my education.
Codius
Active Member
Active Member
 
Posts: 17
Joined: June 6th, 2006, 12:55 pm
Location: Sweden

Postby Johnny_Bit » March 30th, 2007, 2:01 pm

Double buffered to true, process messages on each iteration. shoud work fine
Johnny_Bit
VIP Member
VIP Member
 
Posts: 455
Joined: June 15th, 2003, 9:56 am

Postby Codius » March 30th, 2007, 5:18 pm

Well it's certainly an improvement, but still objects such as labels which are aligned to something will flicken like crazy
I've never let my schooling interfere with my education.
Codius
Active Member
Active Member
 
Posts: 17
Joined: June 6th, 2006, 12:55 pm
Location: Sweden

Postby Kambiz » March 30th, 2007, 10:08 pm

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.
Kambiz
User avatar
Kambiz
Administrator
Administrator
 
Posts: 2429
Joined: March 7th, 2003, 7:10 pm

Postby Codius » March 31st, 2007, 10:52 am

thanks alot, the problem was that I had everything in panels already, but I didn't set the panels to doublebuffered.
I've never let my schooling interfere with my education.
Codius
Active Member
Active Member
 
Posts: 17
Joined: June 6th, 2006, 12:55 pm
Location: Sweden


Return to Delphi Programming

Who is online

Users browsing this forum: No registered users and 1 guest

cron