Solved

Disable window update

Posted on 2002-05-10
6
943 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 50 total points
Comment Utility
memo1.lines.beginupdate;

don't forget

memo1.lines.endupdate;

after your insert action

meikl ;-)
0
 
LVL 10

Expert Comment

by:Jacco
Comment Utility
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
Comment Utility
Oops (cut and past is not always very good)

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

Expert Comment

by:SteveWaite
Comment Utility
 LockWindowUpdate(Memo1.Handle);
  // do your stuff
  // ..
  LockWindowUpdate(0);

Regards,
Steve
0
 
LVL 2

Expert Comment

by:mikepj
Comment Utility
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
Comment Utility
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

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…
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

771 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

16 Experts available now in Live!

Get 1:1 Help Now