M
mis12
Unregistered / Unconfirmed
GUEST, unregistred user!
大家好又有新問題了﹐我在button里加了一個圖片顯示﹐這可顯示但運行后圖片就不見了
謝謝大家的指點﹐如果分不夠以后寫完這個控件我就加400分給大家.
unit Plzl1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ExtCtrls, Buttons;
type
TPlzl1 = class(TPanel)
SB1: TSpeedButton;
private
FaGlyph:TBitmap;
function getaglyph: tbitmap;
procedure setaglyph(value :tbitmap);
protected
public
constructor Create(AOwner: TComponent);override;
procedure Paint; override;
destructor Destroy; override;
published
property aGlyph: TBitmap read GetaGlyph write SetaGlyph;
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('Standard', [TPlzl1]);
end;
procedure tplzl1.Paint;
begin
inherited;
end;
function tplzl1.getaglyph:tbitmap;
begin
result := Faglyph;
end;
procedure tplzl1.setaglyph(value :tbitmap);
begin
faglyph:=value;
sb1.Glyph := value;
end;
destructor Tplzl1.Destroy;
begin
sb1.Free;
inherited Destroy;
end;
end.
謝謝大家的指點﹐如果分不夠以后寫完這個控件我就加400分給大家.
unit Plzl1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ExtCtrls, Buttons;
type
TPlzl1 = class(TPanel)
SB1: TSpeedButton;
private
FaGlyph:TBitmap;
function getaglyph: tbitmap;
procedure setaglyph(value :tbitmap);
protected
public
constructor Create(AOwner: TComponent);override;
procedure Paint; override;
destructor Destroy; override;
published
property aGlyph: TBitmap read GetaGlyph write SetaGlyph;
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('Standard', [TPlzl1]);
end;
procedure tplzl1.Paint;
begin
inherited;
end;
function tplzl1.getaglyph:tbitmap;
begin
result := Faglyph;
end;
procedure tplzl1.setaglyph(value :tbitmap);
begin
faglyph:=value;
sb1.Glyph := value;
end;
destructor Tplzl1.Destroy;
begin
sb1.Free;
inherited Destroy;
end;
end.