PeterPanettone 157 Posted June 28, 2020 In a Delphi 10.4 VCL Application, I have a TPageControl container with a TTabSheet page (with TabVisible = False) and a TPanel on that TabSheet: Although the Panel has Align = alClient, the Panel does not completely fill the TabSheet area: The TabSheet creates a MARGIN AREA around the Panel which I cannot get rid of. (The margin area is from the TabSheet and not from the Form, as the Form.Color is set to Fuchsia). So I thought I could make the margin invisible by setting the TabSheet color to the same color as the Panel. BUT TTabSheet does not have a color property! I have attached the very simple project, so you can play around with it yourself: TabSheetColor.zip Question: Is there a way to set the color of the full area of the TabSheet or to remove that margin from the TabSheet? Share this post Link to post
David Heffernan 2345 Posted June 28, 2020 It would be far simpler to remove the page control and tabsheet and have the panel placed directly on the form. Share this post Link to post
PeterPanettone 157 Posted June 28, 2020 5 minutes ago, David Heffernan said: It would be far simpler to remove the page control and tabsheet and have the panel placed directly on the form. If you have several panels then the handling becomes expensive. Anything about the TPageControl/TTabsheet? Share this post Link to post
Achim Kalwa 61 Posted June 28, 2020 39 minutes ago, PeterPanettone said: Anything about the TPageControl/TTabsheet? You may try to set PageControl.Style to tsFlatButtons (but I don't know if the result is what you want). Share this post Link to post
Mahdi Safsafi 225 Posted June 28, 2020 Is that what you want ? procedure TForm1.FormCreate(Sender: TObject); type TControlHack = type TControl; begin TControlHack(pgc1).Color := clWindow; end; Share this post Link to post
David Heffernan 2345 Posted June 28, 2020 1 hour ago, PeterPanettone said: If you have several panels then the handling becomes expensive. It's not at all difficult. Put them in a collection and hide all of them apart from the active one. Has the benefit of doing exactly what you want. Share this post Link to post
PeterPanettone 157 Posted June 28, 2020 4 hours ago, David Heffernan said: It's not at all difficult. Put them in a collection and hide all of them apart from the active one. Good idea. Could you provide some example code? Share this post Link to post
David Heffernan 2345 Posted June 29, 2020 I'm sure you know how to work with list objects, and how to set the Visible property. 1 Share this post Link to post
Uwe Raabe 2057 Posted June 29, 2020 Seems that a TCardPanel is better suited for your needs. Quote Use the TCardPanel to manage a collection of cards. Each card is a container for other controls and only one card is active/visible at a time. 1 2 Share this post Link to post
Edwin Yip 154 Posted June 29, 2020 See: https://stackoverflow.com/a/6275161/133516 Also note my comments under that answer. 1 Share this post Link to post