I am currently using Winforms. The application I am trying to build is basically a POC, so I am no sure whether C++ is the correct language to use and I am not sure whether my approach is correct.
The application will basically act as a front end for designing IPL label formats. Users must be able to add any amount of text fields, barcodes, lines, etc. to the label design. From there I can determine the exact position of these items, and generate the IPL code for export.
IPL can become very messy and if you don't work with it every day, it tends to take a lot of time to generate simple formats. I hope a design tool will make life easier.
In your case you'd be creating "panel1" dynamically and so you'd already have to have premade_MouseDown() written out instead of panel1_MouseDown. So you'd have a statement like the above after you've created your object where you're hooking up your method to the control.
That's probably as clear as mud. You just have to do in code what the Winforms does for you when you double click on an event in the properties.
Do some searching for this topic under ASP.NET sites (or even in the ASP.NET forum here :) ) as I think this is more common occurrence in that domain.