usesCommCtrl;procedure TForm1.Button1Click(Sender: TObject);begin// Set the Background color to tealProgressbar1.Brush.Color := clTeal;// Set bar color to yellowSendMessage(ProgressBar1.Handle, PBM_SETBARCOLOR, 0, clYellow);end;WinXP风格进度条const{$EXTERNALSYM PBS_MARQUEE}PBS_MARQUEE = 08; procedure TForm1.FormCreate(Sender: TObject);beginSetWindowLong(ProgressBar1.Handle, GWL_STYLE,GetWindowLong(ProgressBar1.Handle, GWL_STYLE) or PBS_MARQUEE);end;//------------------------------------------------------------------------------procedure TForm1.Button1Click(Sender: TObject);vari: Integer;beginfor i := 0 to 30 dobeginSleep(100);ProgressBar1.StepIt;Application.ProcessMessages;end;end;
class function fname(params)
你声明一个类方法的时候,默认都是STATIC的; Methods are by default static. When a static method is called, the declared (compile-time) type of the class or object variable used in the method call determines which implementation to activate. In the following example, the Draw methods are static.type TFigure = class procedure Draw; end; TRectangle = class(TFigure) procedure Draw; end;
Methods are by default static. When a static method is called, the declared (compile-time) type of the class or object variable used in the method call determines which implementation to activate. In the following example, the Draw methods are static.type
TFigure = class
procedure Draw;
end;
TRectangle = class(TFigure)
procedure Draw;
end;
如果一定需要,可以声明全局函数啊。
关于静态方法,我只是想探讨一下,怎样实现我知道,只是觉得既然支持oop那么就应该有静态方法。
天外流星的话我不动,既然是静态的为什么不可以不需要生成实例就直接调用???