Hello, I have a question about what I do to stock 2 SpeedButtons in 2 variables and next, compare this 2.
The error ---> "unit1.pas(61,32) Error: Incompatible types: got "Int64" expected "TSpeedButton"
If anyone has a suggestion that might support the project, even though it has nothing to do with what was asked, please say.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Olá, eu tenho uma dúvida sobre como eu posso fazer para armazenar 2 speedbuttons em variáveis para poder compará-los.
Vou postar o código a seguir, mas o erro é o falado acima.
Se alguém tiver uma sugestão que possa me ajudar no projeto, mesmo que não tenha nada a ver com o que eu perguntei, pode falar.
Desde já agradeço!
This is my code
unit Unit1;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, Forms, Controls, Graphics, Dialogs, Buttons;
type
{ TForm1 }
TForm1 = class(TForm)
ImageList1: TImageList;
SpeedButton1: TSpeedButton;
SpeedButton2: TSpeedButton;
SpeedButton3: TSpeedButton;
SpeedButton4: TSpeedButton;
SpeedButton5: TSpeedButton;
SpeedButton6: TSpeedButton;
procedure FormCreate(Sender: TObject);
procedure SpeedButton1Click(Sender: TObject);
procedure SpeedButton2Click(Sender: TObject);
procedure SpeedButton3Click(Sender: TObject);
procedure SpeedButton4Click(Sender: TObject);
procedure SpeedButton5Click(Sender: TObject);
procedure SpeedButton6Click(Sender: TObject);
private
public
end;
var
Form1: TForm1;
b1,b2: TSpeedButton;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.SpeedButton1Click(Sender: TObject);
begin
ImageList1.GetBitmap(0, SpeedButton1.Glyph);
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
SpeedButton1.tag := 1;
SpeedButton2.tag := 2;
SpeedButton3.tag := 2;
SpeedButton4.tag := 3;
SpeedButton5.tag := 1;
SpeedButton6.tag := 3;
if (b1 = nil) then
b1 := TSpeedButton(sender).tag;
else
b2 := TSpeedButton(sender).tag;
end;
if b1=b2 then
begin
exit;
end;
end;
procedure TForm1.SpeedButton2Click(Sender: TObject);
begin
ImageList1.GetBitmap(1, SpeedButton2.Glyph);
end;
procedure TForm1.SpeedButton3Click(Sender: TObject);
begin
ImageList1.GetBitmap(1, SpeedButton3.Glyph);
end;
procedure TForm1.SpeedButton4Click(Sender: TObject);
begin
ImageList1.GetBitmap(2, SpeedButton4.Glyph);
end;
procedure TForm1.SpeedButton5Click(Sender: TObject);
begin
ImageList1.GetBitmap(0, SpeedButton5.Glyph);
end;
procedure TForm1.SpeedButton6Click(Sender: TObject);
begin
ImageList1.GetBitmap(2, SpeedButton6.Glyph);
end;
end.