首先定义一属性:
published
property HnitFont: TFont read FHintFont write SetHintFont;
对SetHintFont写了一过程
procedure TFrThreeFloor.SetHintFont(Value: TFont);
begin
if FHintFont <> Value then
begin
FHintFont := Value;
if FHintWindow <> nil then
FHintWindow.font := FHintFont;
end;
end;执行到此过程时报地址错误,编译无错。
请高手帮忙,谢谢!
published
property HnitFont: TFont read FHintFont write SetHintFont;
对SetHintFont写了一过程
procedure TFrThreeFloor.SetHintFont(Value: TFont);
begin
if FHintFont <> Value then
begin
FHintFont := Value;
if FHintWindow <> nil then
FHintWindow.font := FHintFont;
end;
end;执行到此过程时报地址错误,编译无错。
请高手帮忙,谢谢!
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, uFrBaseForm, StdCtrls, Buttons, DB, ADODB;type
TFrThreeFloor = class(TFrBaseForm)
edtbatchno: TEdit;
btnfind: TBitBtn;
ComboBox1: TComboBox;
BitBtn1: TBitBtn;
ADOQuery1: TADOQuery;
procedure btnfindClick(Sender: TObject);
procedure edtbatchnoKeyPress(Sender: TObject; var Key: Char);
procedure ADOQuery1AfterScroll(DataSet: TDataSet);
procedure BitBtn1Click(Sender: TObject);
procedure FormCloseQuery(Sender: TObject; var CanClose: Boolean);
procedure FormCreate(Sender: TObject);
procedure edtbatchnoMouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
private
FHintFont: TFont;
FHintWindow: THintWindow;
function FunGetJobNo: string;
procedure SetHintFont(value: TFont); { Private declarations }
public
{ Public declarations }
published
property HnitFont: TFont read FHintFont write SetHintFont; //Lijp
end;
var
FrThreeFloor: TFrThreeFloor;implementation
uses uMessagebox, uDataMod;procedure TFrThreeFloor.FormCreate(Sender: TObject);
var
NewHintFont: TFont;
begin
inherited;
NewHintFont := TFont.Create;
NewHintFont.Name := '幼圆';
NewHintFont.Size := 14; Application.HintPause := 10; //间隔多少时间显示
Application.HintColor := clRed; //底色
//FrThreeFloor.HnitFont := NewHintFont;
// Self.HnitFont := NewHintFont;
FrThreeFloor.HnitFont := NewHintFont;
end;
procedure TFrThreeFloor.SetHintFont(Value: TFont); //2007-6-18 by Lijp
begin
{if FHintFont <> Value then
begin
FHintFont := Value;
if FHintWindow <> nil then
FHintWindow.font := FHintFont;
end; }
FHintWindow.Font.Assign(FHintFont);end;还是有问题,请帮忙再看看
FHintWindow:=THintWindow.Create(Application);
再帮忙看看!procedure TFrThreeFloor.FormCreate(Sender: TObject);
var
NewHintFont: TFont;
begin
inherited;
FHintWindow := THintWindow.Create(Application);
FHintFont := TFont.Create;
NewHintFont := TFont.Create;
NewHintFont.Name := '幼圆';
NewHintFont.Size := 14; Application.HintPause := 10; //间隔多少时间显示
Application.HintColor := clRed; //底色
//FrThreeFloor.HnitFont := NewHintFont;
// Self.HnitFont := NewHintFont;
FrThreeFloor.HnitFont := NewHintFont;
end;procedure TFrThreeFloor.SetHintFont(Value: TFont); //2007-6-18 by Lijp
begin
if FHintFont <> Value then
begin
FHintFont := Value;
if FHintWindow <> nil then
FHintWindow.font := FHintFont;
end;
end;
begin
if FHintFont <> Value then //不要
begin //不要
FHintFont := Value;//不要
if FHintWindow <> nil then//不要
FHintWindow.font := FHintFont;//不要
end;//不要
FHintWindow.Font.Assign(value); 直接这样就行了
end;
FHintFont :=Tfont.create();
此前要进行创建!