T
tempname
Unregistered / Unconfirmed
GUEST, unregistred user!
我想在状态栏里用图标提示是否已经连上了网络代码如下:
procedure TForm1.StatusBar1DrawPanel(StatusBar: TStatusBar;
Panel: TStatusPanel; const Rect: TRect);
var filename:string;
begin
filename:=extractFilePath(paramstr(0))+'image/';
if InternetCheckConnection('http://www.yahoo.com/', 1, 0) then
image1.Picture.LoadFromFile(filename+'isconnect2.bmp')
else
image1.Picture.LoadFromFile(filename+'isconnect1.bmp');
image1.Parent:=statusbar1;
image1.Left:=rect.left+5;
image1.top:=rect.top-4;
image1.width:=panel.width;
image1.height:=rect.bottom-rect.top;
end;
我把状态栏分成panels,只有其中一个style属性设为sOwnerDraw
为什么运行的时候这段代码会不停在运行呢?请多指教
procedure TForm1.StatusBar1DrawPanel(StatusBar: TStatusBar;
Panel: TStatusPanel; const Rect: TRect);
var filename:string;
begin
filename:=extractFilePath(paramstr(0))+'image/';
if InternetCheckConnection('http://www.yahoo.com/', 1, 0) then
image1.Picture.LoadFromFile(filename+'isconnect2.bmp')
else
image1.Picture.LoadFromFile(filename+'isconnect1.bmp');
image1.Parent:=statusbar1;
image1.Left:=rect.left+5;
image1.top:=rect.top-4;
image1.width:=panel.width;
image1.height:=rect.bottom-rect.top;
end;
我把状态栏分成panels,只有其中一个style属性设为sOwnerDraw
为什么运行的时候这段代码会不停在运行呢?请多指教