Solved

Outlook 2000 Effect

Posted on 2001-06-19
7
165 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

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…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
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…
Suggested Courses
Course of the Month5 days, 18 hours left to enroll

627 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