L
lmtfw
Unregistered / Unconfirmed
GUEST, unregistred user!
我定义了个控件从DBCHART继承,声明了个TCOMBOBOX类的内部变量FCOMBOLX,它的相应属性是
COMBOLX,其中定义了COMBOLX的存取方法,可是就无法对其付值,各位帮我看看
unit vdbChart;
interface
uses
Windows, Messages, SysUtils, Classes, Controls, ExtCtrls, TeeProcs,
TeEngine, Chart, DbChart, Graphics, Forms,
Dialogs, DB, DBTables, StdCtrls, Series, dxExEdtr, dxDBTLCl, dxGrClms, dxTL, dxDBCtrl, dxDBGrid,
dxCntner;
type
tvdbChart = class(tdbChart)
private
fcombolx:TComboBox;
{ Private declarations }
protected
{ Protected declarations }
public
procedure setfcombolx(value:tcombobox);
{ Public declarations }
published
combolx:tcombobox read fcombolx write setfcombolx ;
{ Published declarations }
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('SAMPLE', [tvdbChart]);
end;
{ tvdbChart }
procedure tvdbChart.setfcombolx(value: tcombobox);
begin
if assigned(value) then
fcombolx.Assign(value);
end;
end.
我在主程序中使用的时候付值
procedure TForm1.Button2Click(Sender: TObject);
begin
DBCHART1.combolx:=combobox3;
end;
可是值只付给了COMBOLX,而FCOMBOLX却是空的,我跟踪了一下,SETFCOMBOLX好象更本没有
运行过。这是怎么回事啊?
COMBOLX,其中定义了COMBOLX的存取方法,可是就无法对其付值,各位帮我看看
unit vdbChart;
interface
uses
Windows, Messages, SysUtils, Classes, Controls, ExtCtrls, TeeProcs,
TeEngine, Chart, DbChart, Graphics, Forms,
Dialogs, DB, DBTables, StdCtrls, Series, dxExEdtr, dxDBTLCl, dxGrClms, dxTL, dxDBCtrl, dxDBGrid,
dxCntner;
type
tvdbChart = class(tdbChart)
private
fcombolx:TComboBox;
{ Private declarations }
protected
{ Protected declarations }
public
procedure setfcombolx(value:tcombobox);
{ Public declarations }
published
combolx:tcombobox read fcombolx write setfcombolx ;
{ Published declarations }
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('SAMPLE', [tvdbChart]);
end;
{ tvdbChart }
procedure tvdbChart.setfcombolx(value: tcombobox);
begin
if assigned(value) then
fcombolx.Assign(value);
end;
end.
我在主程序中使用的时候付值
procedure TForm1.Button2Click(Sender: TObject);
begin
DBCHART1.combolx:=combobox3;
end;
可是值只付给了COMBOLX,而FCOMBOLX却是空的,我跟踪了一下,SETFCOMBOLX好象更本没有
运行过。这是怎么回事啊?