W
wjdragon
Unregistered / Unconfirmed
GUEST, unregistred user!
对于arhaha上面的代码,当我把point1,point2改为可读写的以后,对他们的值进行改变,为什么结果有问题?例如:新建一个窗体,代码如下
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, LinLine, StdCtrls;
type
TForm1 = class(TForm)
LinLine1: TLinLine;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
dot1,dot2:TPoint;
begin
dot1.X := 100;
dot1.Y := 100;
dot2.X := 20;
dot2.Y := 400;
LinLine1.Point1 := dot1;
LinLine1.Point2 := dot2;
end;
end.
运行后,出现一条直线,但是当我按下button后,直线就不见了,为什么呢?
另:你们有谁能告诉我如上面所说的:怎样对下层的控件发送点中的消息,比如说两条line重叠的情况。谢谢
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, LinLine, StdCtrls;
type
TForm1 = class(TForm)
LinLine1: TLinLine;
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.Button1Click(Sender: TObject);
var
dot1,dot2:TPoint;
begin
dot1.X := 100;
dot1.Y := 100;
dot2.X := 20;
dot2.Y := 400;
LinLine1.Point1 := dot1;
LinLine1.Point2 := dot2;
end;
end.
运行后,出现一条直线,但是当我按下button后,直线就不见了,为什么呢?
另:你们有谁能告诉我如上面所说的:怎样对下层的控件发送点中的消息,比如说两条line重叠的情况。谢谢