The Sub-Class sounds good for me, I don't care whether the Panel is created dynamically or by design time.
But when I try your solution, it gives me the following Error in these lines:
unit1.pas(279,22) Error: Variable identifier expected
In:
OnMouseWheelDown:=@MouseWheelDown;
OnMouseWheelUp:=@MouseWheelUp;
EDIT: It works fine for me if I copy your code in a new project, but the Error is still appearing when I try to do it in my Project, I'll edit it once again after a deep code-cleaning....
EDIT²: I rewrote some parts of my Project and I found out, that there must be a Problem with my uses-List. There is an error with the HDC I use for OpenGL. It appears if I add the Windows-unit to my code (which I need for the HDC), but then the Error shown below appears.
uses
Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs,
Menus, StdCtrls, ExtCtrls, Buttons, Spin, ComCtrls, LoadSave, dglOpenGL,
Windows, ExportObj, unit_options, types, stuff, ptx_texture;