不知delphi里有没有类似SetRedraw(false)功能的函数?(200分)

  • 主题发起人 主题发起人 lgq
  • 开始时间 开始时间
可以这样作:
procedure TForm1.SetRedraw(AListBox:TListBox;value: Boolean);
begin
with AListBox do
if value then begin
SendMessage(Handle,WM_SETREDRAW,1,0);
InvalidateRect(Handle,nil,true);
end else
SendMessage(Handle,WM_SETREDRAW,0,0);
end;
 
成对使用:
BeginUpdate
try
do something
finally
EndUpdate;
end;
 
应该是:
procedure TForm1.SetRedraw(sender:TObject;value: Boolean);
begin
with sender as TWinControl do
if value then begin
SendMessage(Handle,WM_SETREDRAW,1,0);
InvalidateRect(Handle,nil,true);
end else
SendMessage(Handle,WM_SETREDRAW,0,0);
end;
 
呀,来晚了,该说的别人都说了,
我以前的一个例子:
procedure newrich.ontextChange(sender:tobject);
begin
if lines.count>83 then
begin
while lines.count>83 do
begin
sendmessage(handle,wm_setredraw,0,0);
lines.delete(0);
sendmessage(handle,wm_setredraw,1,0);
end;
selstart:=length(text);
end;
end;
 
多人接受答案了。
 
后退
顶部