Reintroduce events and properties suppressed in ancestors? lazarus / 31-LCL ---------------------------------------------------------------------- vfclists · 2024-10-04 22:00 I need to create a panel type component that can respond to key strokes and when I observe the hierarchy of TPanel it is descended from TWinControl which handles the key events which have been suppressed by the closer ancestors in the component hierarchy. Do I have to create new control derived from TWinControl or can I inherit from TPanel and restore them? This link Overriding and redeclaring properties suggests it is possible, but the keyboard events are removed from TCustomPanel and TCustomControl ---------------------------------------------------------------------- jamie · 2024-10-04 22:17 I don't know what you are talking about? Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i uses  Classes, SysUtils, Forms, Controls, Graphics, Dialogs, PairSplitter, ExtCtrls,  StdCtrls; type   { TForm1 }   TForm1 = class(TForm)    Panel1: TPanel;    procedure AKeyPress(Sender: TObject; var Key: char);    procedure Panel1Click(Sender: TObject);  private   public   end; var  Form1: TForm1; implementation {$R *.lfm} { TForm1 } procedure TForm1.AKeyPress(Sender: TObject; var Key: char);begin  beep;end; procedure TForm1.Panel1Click(Sender: TObject);begin  Panel1.SetFocus;  Panel1.OnKeyPress := @AKeyPress;end;   First click on the panel to get it to focus. ---------------------------------------------------------------------- vfclists · 2024-10-04 23:17 I have created a descendant of TPanel which responds to key events. What I need now is for it to have some kind of KeyPreview property so that it too can intercept keystrokes meant for controls placed on it. ---------------------------------------------------------------------- Joanna · 2024-10-04 23:58 I have done things similar to this with change events when I want the parent control to intercept events for child controls. You can call the keydown event for child control from inside the parent control keydown event handler. You will need to identify what sent the event using “is” and typecast the sender too