This is an easy way to assign onkeydown event in all edit controls created by TAdvDBFormPanel:
1 2 3 4 5 6 7 8 9 10 |
var i:integer; editp:TDBAdvEdit; begin for i:=0 to AdvDBFormPanel1.layout.Items.Count - 1 do if AdvDBFormPanel1.layout.Items.Items[i].DataControl = dcedit then begin editp:=(AdvDBFormPanel1.layout.Items.Items[i].EditCtrl as TDBAdvEdit); editp.OnKeyDown:=Edit1KeyDown; end; |