form1.repaint;
form1.Canvas.pen.color:=clGreen;
form1.Canvas.pen.width:=5;
form1.Canvas.polyline([point(Button1.left,Button1.top),
point(Button1.left+Button1.width,Button1.top),
point(Button1.left+Button1.width,Button1.top+Button1.hei
ght),
point(Button1.left,Button1.top+Button1.height),
point(Button1.left,Button1.top)]);
end;
procedure TForm1.Button2MouseMove
(Sender:TObject;Shift:TShiftState;X,
Y:Integer);
begin
form1.repaint;
form1.Canvas.pen.color:=clBlue;
form1.Canvas.pen.width:=5;
form1.Canvas.polyline([point(Button2.left,Button2.top),
point(Button2.left+Button2.width,Button2.top),
point(Button2.left+Button2.width,Button2.top+Button2.hei
ght),
point(Button2.left,Button2.top+Button2.height),
point(Button2.left,Button2.top)]);
end;
procedure TForm1.FormMouseMove
(Sender:TObject;Shift:TShiftState;X,
Y:Integer);
begin
form1.repaint;
form1.Canvas.pen.color:=clRed;
form1.Canvas.pen.width:=3;
form1.Canvas.polyline([point(0,0),point(form1.width-
10,0),
point(form1.width-10,form1.height-30),
point(0,form1.height-30),point(0,0)]);
end;
3.为图形按钮或其它控件安装动态帮助功能,此处主要使用它的
字符串显示功能,也就是当鼠标移到指定控件上时,在其周围适当
位置显示相应的字符串,当鼠标离开时通过图像覆盖动作使字符
串消失,也可以使用一个简单的命令完成即form1.repaint,它的
作用是使FORM1内的所有控件全部重新绘制,这样即可快速清除
原来显示的字符;编程时主要使用各个控件的MouseMove()事件;
比如可在窗口中安放两个按钮,并安排如下代码,运行之后当鼠标
移到相应按钮上时,就会在其上方显示相应的提示信息,鼠标移到
窗口空白处则会在窗口的左下角显示"OK"字样;
procedure TForm1.Button1MouseMove
(Sender:TObject;Shift:TShiftState;X,Y:Integer);
begin
form1.repaint;
form1.Canvas.brush.color:=clGreen;
form1.Canvas.font.size:=8; &nbs