On Jan 30, 2008 9:05 AM, A.J. Venter <[EMAIL PROTECTED]> wrote: > 2) THIS is the tricky one so I would like some advice on how I should do > it. TDoubleBuffer needs to have OnKeyDown,OnKeyUp and OnKeypressed > events. Being a TCustomControl descendent, it doesn't have them - > TControl does - but it doesn't have a paint handler. > ... > The other way I can think of is to just code the keyboardEvents in, by > copying and pasting from one of the components that do have it - that > seems like clutter though - code duplication is never a good idea right.
How about a middle ground: create a new TKeyboardEvents unit using code from one of the components that already has it. Yes you will have the initial code duplication in creating the unit in the first place, but this would allow adding keyboard events to other controls simply by inheriting from the base class. In fact, this may be something that the LCL could use and incorporate itself in the future, if you get it working property. _________________________________________________________________ To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe" as the Subject archives at http://www.lazarus.freepascal.org/mailarchives