0

I want to move a TableLayoutPanel and all it's content over my Form. Moving itself is no Problem. I don't want to move the actual Control, when still holding down the Mouse Button but instead I want a faded out copy on my mouse.

My first idea was just to get a copy of the tlp, tweak a bit with Alpha. I've found this for copying my control, but this won't work with a tlp, because of the Settings.

Before I fix this code, i wanted to ask, if there is a easier Method for this. I don't need a working copy of my controls, only a visual copy.

My function should be a general function. I won't know which controls might get added into the tlp. Having a working copy might result in some unwanted events.

Is there a easy function to get a visual copy or do i really need to make a copy and remove all events from the controls of that copy?

LarsTech
  • 80,625
  • 14
  • 153
  • 225
JP-Hundhausen
  • 70
  • 1
  • 7
  • 1
    Use its DrawToBitmap() method, fade it with Graphics.FillRectangle(). – Hans Passant Jul 31 '19 at 08:18
  • Do you mean you want to drag the TLP at run-time, clicking anywhere inside it? Or you have a drag placeholder/marker as the one the TLP shows when you click on it at design-time? – Jimi Jul 31 '19 at 15:58
  • @Jimi The idea was to drop the TLP in a Panel and when dropped, the code rearanges all TLPs inside that Panel, accordingly. My current state is that i place a bitmap copy of the TLP, the original control sticks to the mouse but not visible (needed the mouse move event and changing the alpha doesnt work) . On the Mouse is now a bitmap, that indicates the movement. I don't care how it's done. It just need to look nice, work and work under .net 2 (not my choice) – JP-Hundhausen Aug 01 '19 at 06:51
  • Also I discarded my Idea. Drawing and placing so much in a Form is not that easy. .Net 2.0 and WinForms are not the best idea for this modern design. Probably i need to go over the panel mouse move event and not the from tlp. – JP-Hundhausen Aug 01 '19 at 08:02

0 Answers0