DELPHI高手请进,TLISTVIEW ONCUSTDRAWITEM的消息(在线等,答完即结帖)
本人这两天做了个透明背景的LISTVIEW,目的是可以自由的换取窗体背景图片,手工添加子项时,当窗体显示看不到其子项或者最大化窗体也看不到子项。当点击LISTVIEW 可以看到子项的图标(ONCUSTDRAWITEM里写了代码)是不是因为
在控件的
procedure TRichListview .CreateParams(var Params: TCreateParams);
begin
inherited CreateParams(Params);
//Params.ExStyle := Params.ExStyle ;
with Params do
begin
{ 完全重画 }
Style := Style and not WS_CLIPCHILDREN;
Style := Style and not WS_CLIPSIBLINGS;
{ 增加透明 }
ExStyle := ExStyle or WS_EX_TRANSPARENT;
end;
end;
procedure TRichListview.WMNcPaint(var message: Tmessage);
var
Rect: TRect;
begin
Rect := ClientRect;
Rect.Left := Left;
Rect.Right := Left + Width;
Rect.Top := Top;
Rect.Bottom := Top + Height;
Canvas.CopyRect(ClientRect, self.Canvas, Rect);
sendmessage(handle,?????,0,0)?????????????????????????
end;
是不是因为没在此函数中添加重画子项的消息?