## Smooth sliding of form..

Please discuss general Delphi programming topics here.

### Smooth sliding of form..

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 dobegin  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

Posts: 17
Joined: June 6th, 2006, 12:55 pm
Location: Sweden

Double buffered to true, process messages on each iteration. shoud work fine
Johnny_Bit
VIP Member

Posts: 455
Joined: June 15th, 2003, 9:56 am

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

Posts: 17
Joined: June 6th, 2006, 12:55 pm
Location: Sweden

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

Kambiz
Administrator

Posts: 2430
Joined: March 7th, 2003, 7:10 pm

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

Posts: 17
Joined: June 6th, 2006, 12:55 pm
Location: Sweden

Return to Delphi Programming

### Who is online

Users browsing this forum: Bing [Bot] and 3 guests