Fórum Componente não fica visível no form! #406162
07/08/2011
0
O que poderia estar ocorrendo?
segue o código:
unit Unit1;
interface
uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Unit2;
type TForm1 = class(TForm) private { Private declarations } public { Public declarations } end;
var Form1: TForm1; te : teste;
implementation
Begin
{$R *.dfm}
te := teste.Create; te.testes;
end.
_______________________________________________________________
unit Unit2; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Unit1; type teste = class private protected public procedure testes; end; implementation uses Unit1; procedure teste.testes;var t : TButton; begin t := TButton.Create(Form1); t.Parent := Form1; t.Height := 100; t.Width := 100; t.top := 136; t.left := 192; t.Visible := true; end; end.
Olocobixo
Curtir tópico
+ 0Posts
08/08/2011
Wilson Junior
Espero ter colaborado.
Gostei + 0
08/08/2011
Olocobixo
Obrigado.
Gostei + 0
08/08/2011
Wilson Junior
Form2 ===== private MeuBotao: TButton; public procedure CriarBotao(AParent: TWinControl); end; procedure Form2.CriarBotao(AParent: TWinControl); begin MeuBotao := TButton.Create( AParent ); MeuBotao.Parent := AParent; MeuBotao.Height := 100; MeuBotao.Width := 100; MeuBotao.Top := 136; MeuBotao.Left := 192; MeuBotao.Visible := true; end; Form1 ===== Form2.CriarBotao( Form1 );
Espero ter colaborado.
Gostei + 0
Clique aqui para fazer login e interagir na Comunidade :)