Solved

Outlook 2000 Effect

Posted on 2001-06-19
7
164 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction The parallel port is a very commonly known port, it was widely used to connect a printer to the PC, if you look at the back of your computer, for those who don't have newer computers, there will be a port with 25 pins and a small print…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…

728 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