procedure Sqlchangthread.execute;
begin
FreeOnTerminate := True;
Dbgrideh1.Canvas.lock; //去掉这句就会经常出现 Canvas does not allow drawing 错误
//但是一加上去就会无响应假死
with ADOQuery1 do
begin
Close;
DisableControls;
Prepared:=true;
SQL.clear;
sql.Add('select * from tablename ');
open;
EnableControls;
end;
Dbgrideh1.Canvas.Unlock;
end;
begin
FreeOnTerminate := True;
Dbgrideh1.Canvas.lock; //去掉这句就会经常出现 Canvas does not allow drawing 错误
//但是一加上去就会无响应假死
with ADOQuery1 do
begin
Close;
DisableControls;
Prepared:=true;
SQL.clear;
sql.Add('select * from tablename ');
open;
EnableControls;
end;
Dbgrideh1.Canvas.Unlock;
end;
解决方案 »
- 在记录类型中写函数
- 英雄!关于cxgrid获得鼠标焦点信息的问题!!!
- 求一DataSet与DBGrid相关的解决方法!!
- 关于商用POS系统
- delphi中用sql怎么建索引啊?
- 请求帮忙,很急!
- stringgridex是for D6的还是for D5的?dsgnintf.dcu怎么解决的啊?你们是怎么装的?
- Delphi 2007 Remobjects分布式ERP模型(附加源码)
- 恳请帮忙!急!有关FileRead函数问题
- 如何用BCRR32去编译RC文件生成REC文件,如果只能在DOS下,请给出具体的步骤?
- 用idhttp如何登录啊?这个cookies怎么写。已抓到
- Idhttp Post数据后投票显示未登陆
What does the error message 'Canvas does not allow drawing ' mean? A:
you may have run out of resources, which means a new DC cannot be
allocated. Usually this is a result of not freeing unused DCs or other
objects you are attempting to draw to an device context that is not yet valid.
Such as in the create constructor of a component. you are trying to draw on a canvas while your last draw-operation has
not finished yet. In this case you can use Canvas.Lock or Canvas.TryLock to fix it.