Solved

Outlook 2000 Effect

Posted on 2001-06-19
7
155 Views
Last Modified: 2010-04-04
Hello,

I'm trying to achieve the same effect that Outlook 2000 creates when the user clicks the find button. ie : There is a piece of smooth animation as the inbox shrinks and the find panel enlarges.
I've tried the following code below (the form is basically a TPanel aligned top and a TListView aligned client) but it flickers a lot. Any ideas?

    while i <= Max(pnlSearch.Height,250) do
    begin
      pnlSearch.Height:=i;
      self.Update;  //without this it looks even worse
      Sleep(20);
      inc(i,12);
    end;


Thanks

Jo
0
Comment
Question by:nnbbb09
7 Comments
 
LVL 5

Expert Comment

by:scrapdog
ID: 6206087
I tried similar code and didn't notice any flickering.  I don't know how to help you out, but I would suggest that you place

Application.ProcessMessages

somewhere in your loop if you're going to call Sleep.
0
 
LVL 2

Expert Comment

by:bugroger
ID: 6207281
Hi,

Try this !

Procedure Delay(mSeconds : Cardinal);
Var
 mSecStart : Cardinal;

Begin
 mSecStart := GetTickCount;
 While mSeconds > (GetTickCount - mSecStart) do Application.ProcessMessages;
End;


...
   while i <= Max(pnlSearch.Height,250) do
   begin
    pnlSearch.Height:=i;
    delay(20);
   end;
...

GL
Bug


0
 
LVL 3

Expert Comment

by:MarcG
ID: 6209309
Tried it but I didn't find an answer ... just a thought, I think it is the Listview that is your main problem with flickering, maybe you should not repaint it all the time but rather not repaint it until the size change is finished.
0
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 3

Author Comment

by:nnbbb09
ID: 6237085
Sorry for the delay in responding. I've tried all 3 approaches ie : ProcessMessages, using bugroger's timer and also disabling updates for the ListView but I still can't achieve the desired effect. I think I'll just revert to making the panel visible/invisible rather than trying to animate it.

Any objections to me deleting this question?

Thanks for your input anyway

Jo
0
 
LVL 5

Expert Comment

by:scrapdog
ID: 6239614
On Torry's (www.torry.ru), there is a small component called TFlickerFreePaintBox.

I tried it yesterday and it worked like a charm.

You might want to download it and check it out.  Although I don't know if you will be able to use the component directly for your purpose, but you might be able to learn something from the source code (it s very short).
0
 
LVL 3

Author Comment

by:nnbbb09
ID: 6256493

Decided to scrap the idea from the project and will just make the panel visible/invisible. Tried the suggestions (and combinations of them) but with no success.
0
 

Accepted Solution

by:
ComTech earned 0 total points
ID: 6282046
Upon request, this question will be removed and points returned.

Thank you,
ComTech
Community Support Moderator
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now