how to make a transparent form inside Panel?
Asked Answered
P

1

1

I need to create at runtime a partial transparent Form inside a Panel.

How might I be able to achieve this?

Paraclete answered 24/5, 2012 at 17:56 Comment(2)
Looks like you are trying to use the wrong tool - forms are not normally embedded into window controls such as TPanel (though there exist exceptions). Also if memory serves only parentless windows with caption can be transparent (but I can be wrong here).Pauper
Have you seen the question from yesterday? How to make a TFrame (and everything on it) partially transparentHavelock
R
2

If your question is only related to the way to put the form in a TPanel then it's quite easy. You only need to call Windows.SetParent() with the handle of the newly created form.

MyNewForm := TMyNewForm.Create(Self); 
Windows.SetParent(MyNewForm.Handle,MyPanel.Handle);

This would also work by using the TForm Property ParentWindow. But it's (quite) possible that the transparency is not handled (I briefly tested with a semi opaque form and it's not drawn correctly, So if the transparency is mandatory it mights be impossible to reach your goal...)

Reclinate answered 25/5, 2012 at 8:7 Comment(1)
Hi. thank you, but when a set the parent, I cannot do make it transparent. I need somethink like "break the parent style". Actually, I need to put any TwinControl in a Panel and make this TWinControl transparent. Or could be a TwinControl in a another one TWinControl. I dont know if I'm clear. sorry. Thank you.Paraclete

© 2022 - 2024 — McMap. All rights reserved.