Re: Disable TListBox Redraw...
- From: erewhon@xxxxxxxxxx (J French)
- Date: Thu, 28 Jul 2005 07:01:29 +0000 (UTC)
On 27 Jul 2005 13:18:17 -0700, alanglloyd@xxxxxxx wrote:
>TStrings.BeginUpdate / TStrings.EndUpdate surrounding your code.
>
>or LockWindowUpdate(MyListbox.Handle) / LockWindowUpdate(0) surrounding
>your code.
LockWindowUpdate is a bit iffy - only one window can be locked.
Here is another method:
procedure TForm1.Button1Click(Sender: TObject);
Var
L9 :Integer;
begin
ListBox1.Perform( WM_SETREDRAW, Integer(False), 0 );
For L9 := 1 To 10 Do
ListBox1.Items.Add( IntToStr( L9 ) );
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
ListBox1.Perform( WM_SETREDRAW, Integer(True), 0 );
//ListBox1.Refresh; {not needed}
end;
I'm not too happy about the typecasting of True and False
.
- Follow-Ups:
- Re: Disable TListBox Redraw...
- From: Maarten Wiltink
- Re: Disable TListBox Redraw...
- References:
- Disable TListBox Redraw...
- From: didi
- Re: Disable TListBox Redraw...
- From: alanglloyd
- Disable TListBox Redraw...
- Prev by Date: Re: finding the day of the year
- Next by Date: Re: Disable TListBox Redraw...
- Previous by thread: Re: Disable TListBox Redraw...
- Next by thread: Re: Disable TListBox Redraw...
- Index(es):