Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Disable window update

Posted on 2002-05-10
6
Medium Priority
?
952 Views
Last Modified: 2011-09-20
hi,
is it possible to disable update of a control? it is a very slow process to insert lines to a tmemo control while the visual update in effect.
thanks
0
Comment
Question by:omavideniz
6 Comments
 
LVL 27

Accepted Solution

by:
kretzschmar earned 200 total points
ID: 7001624
memo1.lines.beginupdate;

don't forget

memo1.lines.endupdate;

after your insert action

meikl ;-)
0
 
LVL 10

Expert Comment

by:Jacco
ID: 7001644
Hi all,

I agree with meikl. I just wanted to say thay I always put the BeginUpdate/EndUpdate in a try/finally structure:

Memo1.Lines.BeginUpdate;
try
  .. code adding lines ..
finally
  Memo1.Lines.BeginUpdate;
end;

Regards Jacco
0
 
LVL 10

Expert Comment

by:Jacco
ID: 7001646
Oops (cut and past is not always very good)

Memo1.Lines.BeginUpdate;
try
 .. code adding lines ..
finally
 Memo1.Lines.EndUpdate;
end;
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

Expert Comment

by:SteveWaite
ID: 7002140
 LockWindowUpdate(Memo1.Handle);
  // do your stuff
  // ..
  LockWindowUpdate(0);

Regards,
Steve
0
 
LVL 2

Expert Comment

by:mikepj
ID: 7002792
When I've needed something with a bit more strength, this is what is use:

with mywincontrol do
 begin
  Perform( WM_SETREDRAW, 0, 0 );
  try
    ...
  finally
    Perform( WM_SETREDRAW, 1, 0 );
    Invalidate;
  end;
 end;

0
 
LVL 2

Expert Comment

by:Hagen040798
ID: 7004339
All above methods don't speedup real, because the painting code is indeed executed, but with one exception. Any response to get a "visible" DeviceContext to the Screen retruns a invalid or virtual DC. This avoid that the following Paintingcode paints on the screen, but don't avoid this Paintingcode itself.
Ok, the System detect this state by every call to functions like Invalidate() or RedrawWindow() and avoid now some addtional code.
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

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 course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Suggested Courses

885 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