Good day sir/ma i want to create a status bar with a rolling information like Os version current User Name Date and time
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ExtCtrls, ComCtrls;
type
TForm1 = class(TForm)
tmr2: TTimer;
stsbr: TStatusBar;
procedure tmr2Timer(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.tmr2Timer(Sender: TObject);
begin
if tmr2.Interval = 3000 then begin
stsbr.Panels[1].Text:= FormatDateTime('dddd' + ', ' + 'dd/mm/yyyy',date) + ', ' + TimeToStr(Time);
tmr2.Interval := 3001;
end else if tmr2.Interval = 3001 then begin
tmr2.Interval := 3002;
stsbr.Panels[1].Text:= 'PC Owner: '+GetUsersName+ ' - '+ GetLocalPCName;
end else if tmr2.Interval = 3002 then begin
tmr2.Interval := 3003;
stsbr.Panels[1].Text:= GetOSVersion;
end else if tmr2.Interval = 3003 then begin
tmr2.Interval := 3000;
stsbr.Panels[1].Text:= GetCPUName;
end;
procedure Form.FormCreate(Sender: TObject);
begin
tmr2Timer(Sender);
end;
end
. that my full code
what i wanted to Achieve was a moving Information on a status bar Please Help if u can thanks..
You should not use
Timer.Interval
as lookout value to determine which data you should show in status bar. Use separate variable to do that. It will make your code cleaner.