关于动态创建(50分)

  • 主题发起人 主题发起人 toddler
  • 开始时间 开始时间
T

toddler

Unregistered / Unconfirmed
GUEST, unregistred user!
在dbchart中我想动态创建曲线
proceduce Tform1.Button1Click(Sender:TObject);
var
a:TLineSeries;
begin
a:=TLineSeries.Create(dbchart1);
dbchart1.addseries(a);
end;
其中的TlineSeries应该在哪声明?为什么一运行就在TlineSeries处出错呢?
 
你用uses中加了Series了没有?
例子:
unit Unit1;

interface

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs,Series, ExtCtrls, TeeProcs, TeEngine, Chart, DbChart, StdCtrls;

type
TForm1 = class(TForm)
Button1: TButton;
DBChart1: TDBChart;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;

var
Form1: TForm1;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
var
a:TLineSeries;
begin
a:=TLineSeries.Create(dbchart1);
dbchart1.addseries(a);
end;

end.
 
接受答案了.
 
后退
顶部