<div dir="ltr"><div>Hola a todos.<br><br></div><div>necesito agregar dos parámetros al evento onClick de un TButton, <br clear="all"></div><div><br></div><div>el error que obtengo es el siguiente:<br>Error:Incompatibles types: got "<procedure variable type of procedure(Tobject, Tedit, Tedit) of object;Register>" expected "<procedure variable type of procedure(TObject) of object;Register>"<br>
<br></div><div>este es mi código.<br> TForm1 = class(TForm)<br> panel1 : TPanel;<br> edit1, edit2 : Tedit;<br> boton1 : Tbutton;<br><br> Button1: TButton;<br> procedure Boton1Click(Sender: TObject; uno, dos : TEdit);<br>
private<br> { private declarations }<br> public<br> { public declarations }<br> end;<br><br>var<br> Form1: TForm1;<br><br>implementation<br><br>{$R *.lfm}<br><br>{ TForm1 }<br><br>procedure TForm1.Boton1Click(Sender: TObject; uno, dos : TEdit);<br>
var<br> tmp : string;<br>begin<br> tmp := uno.Text;<br> uno.text := dos.text;<br> dos.text := tmp;<br>end;<br><br>procedure TForm1.Button1Click(Sender: TObject);<br>begin<br><br> panel1 := Tpanel.Create(Self);<br> panel1.parent := form1;<br>
..<br><br> edit1 := TEdit.Create(Self);<br> edit1.parent := panel1;<br> ..<br><br> edit2 := TEdit.Create(Self);<br> edit2.parent := panel1;<br> ..<br><br> boton1 := TButton.Create(Self);<br> boton1.parent := panel1;<br>
boton1.OnClick := @Boton1Click(Sender, edit1, edit2);<br> ..<br>end;<br><br><br><br></div><div><br></div><div>-- <br>Rafael Bidegain<br><br>Ya que los cuerdos no hablan, hablará el loco.<br>(The Fool, Padraic Pearse)<br>
<br># yo quiero educación libre. ¡YA!<br><br></div>
</div>