Unless this is a constructor (which I highly doubt) then you need a return type. If there's nothing being returned, void
works:
public void Lépés(ref Button but1, ref Button but2)
{
if (but2.Text == "")
{
but2.Text = but1.Text;
but1.Text = "";
}
}
Second, you don't need ref
here:
public void Lépés(Button but1, Button but2)
{
if (but2.Text == "")
{
but2.Text = but1.Text;
but1.Text = "";
}
}
These are reference types by default, and unless you have very specific reasons to use them you shouldn't default to ref
parameters.