//以下是VCL的源程序,请看注释部分问题。
procedure TWinControl.WMPaint(var Message: TWMPaint);
var
DC, MemDC: HDC;
MemBitmap, OldBitmap: HBITMAP;
PS: TPaintStruct;
begin
if not FDoubleBuffered or (Message.DC <> 0) then
begin
if not (csCustomPaint in ControlState) and (ControlCount = 0) then
inherited //这里分明是调用基类的WMPaint方法,可我在其继承类中没有找到该方法,请问怎么回事?
else
PaintHandler(Message);
end
procedure TWinControl.WMPaint(var Message: TWMPaint);
var
DC, MemDC: HDC;
MemBitmap, OldBitmap: HBITMAP;
PS: TPaintStruct;
begin
if not FDoubleBuffered or (Message.DC <> 0) then
begin
if not (csCustomPaint in ControlState) and (ControlCount = 0) then
inherited //这里分明是调用基类的WMPaint方法,可我在其继承类中没有找到该方法,请问怎么回事?
else
PaintHandler(Message);
end
解决方案 »
- Delphi COM 如何在 type Library editor 中插入自己的接口?
- DELPHI 调试运行时,怎么不报错。
- WebBrowser 问题 高手进来看看
- delphi中 获取 数据库 字段 值 问题
- 如何把EnumWindows封装在类中?
- 关于过程内声明对象的销毁问题...
- 能详细讲解一下object pascal中的接口概念吗?
- 请问有谁用过TComm这个通信控件,,,它是怎么清空缓存区数据的????
- 那有for D6 的控件
- delphi问题,急!急!急!
- 想到你,就会笑!呵呵
- 我电脑上的时间是2002年,月份一样,点数慢一个小时,在电脑上改不了,请问是怎么回事,用什么方法改正它
TWinControl->TControl->TCompnent->TPersistent->TObject
看在哪里。
procedure TWinControl.WMPaint(var Message: TWMPaint);
var
DC, MemDC: HDC;
MemBitmap, OldBitmap: HBITMAP;
PS: TPaintStruct;
begin
if not FDoubleBuffered or (Message.DC <> 0) then
begin
if not (csCustomPaint in ControlState) and (ControlCount = 0) then
inherited
else
PaintHandler(Message);
end
else
begin
DC := GetDC(0);
MemBitmap := CreateCompatibleBitmap(DC, ClientRect.Right, ClientRect.Bottom);
ReleaseDC(0, DC);
MemDC := CreateCompatibleDC(0);
OldBitmap := SelectObject(MemDC, MemBitmap);
try
DC := BeginPaint(Handle, PS);
Perform(WM_ERASEBKGND, MemDC, MemDC);
Message.DC := MemDC;
WMPaint(Message);
Message.DC := 0;
BitBlt(DC, 0, 0, ClientRect.Right, ClientRect.Bottom, MemDC, 0, 0, SRCCOPY);
EndPaint(Handle, PS);
finally
SelectObject(MemDC, OldBitmap);
DeleteDC(MemDC);
DeleteObject(MemBitmap);
end;
end;
end;
这里的wndproc继承的是TControl的wndproc
http://topic.csdn.net/t/20030807/22/2121889.html
楼主可以看一看