On 07/27/2015 09:31 AM, Mark Morgan Lloyd wrote: > Péter Gábor wrote: >> Sorry! >> I was "misreading" your mail... you want to know the type of them. >> >> You can compare the type of them: >> >> if Sender = TButton then { do something} ; > > Can this be elegantly put into a case statement? > Hi, I just tried it and no you can't. At least not directly, there may be a way of casting the Sender object to ordinal or string but I'm not sure that is efficient or elegant.
Why not simply iterate the control List: for i := 0 to Controls.Count - 1 do begin If controls[ i ] is TCheckbox then TCheckbox( Controls[ i ] ).Checked := .... end; -- _______________________________________________ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus