Tpaintbox控件的Refresh等三个方法特点、区别?
Tpaintbox控件下面三个方法各自在什么情况下使用,怎样使用:
Refresh ;
Repaint ;
Update ;
[解决办法]
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;