首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

Tpaintbox控件的Refresh等三个步骤特点、区别

2012-09-19 
Tpaintbox控件的Refresh等三个方法特点、区别?Tpaintbox控件下面三个方法各自在什么情况下使用,怎样使用:Re

Tpaintbox控件的Refresh等三个方法特点、区别?
Tpaintbox控件下面三个方法各自在什么情况下使用,怎样使用:
Refresh ;
Repaint ;
Update ;



[解决办法]

Delphi(Pascal) code
procedure TControl.Update;begin  if Parent <> nil then Parent.Update;end;procedure TControl.Refresh;begin  Repaint;end;procedure TControl.Repaint;var  DC: HDC;begin  if (Visible or (csDesigning in ComponentState) and    not (csNoDesignVisible in ControlStyle)) and (Parent <> nil) and    Parent.HandleAllocated then    if csOpaque in ControlStyle then    begin      DC := GetDC(Parent.Handle);      try        IntersectClipRect(DC, Left, Top, Left + Width, Top + Height);        Parent.PaintControls(DC, Self);      finally        ReleaseDC(Parent.Handle, DC);      end;    end else    begin      Invalidate;      Update;    end;end; 

热点排行