Solved

Outlook 2000 Effect

Posted on 2001-06-19
7
160 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
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Using idhttp to login to instagram 2 106
Find and Replace Stream with 0s 8 69
TEMBEDDEDWB how can i change its user agent ? 8 69
Delphi...Split view - idea? 1 88
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…
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…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…

839 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