Forum > Designer

How to display same LCL widget in different TabSheets

(1/3) > >>

Muso:
I have an app with different TabSheet tabs. To speed up he work flow, I want to display the _same_ panel in 2 different tabs.

So I have now a panel in one TabSheet and want to display the same panel now also in another TabSheet .

Is this possible?

Lazarus 2.3.0 r65271 FPC 3.2.2 x86_64-win64-win32/win64

winni:
Hi!

Use the onChange event of the PageControl to change the parent of the panel to the AktivePage:


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---procedure TForm1.PageControl1Change(Sender: TObject);begin  Panel1.Parent :=  PageControl1.ActivePage;  Application.ProcessMessages;end;            

Winni

wp:
I don't know what exactly you want to achieve. But basically the tabbed control which displays the same page content on all tabs is a TTabControl, unlike a TPageControl in which every tab can be different.

Handoko:
Don't know why OP needs it. If what he wants is showing same components on different tabsheets, I ever done it.

Just set the components' parent to the active tabsheet and put the code in the page control's OnChange event.

winni:

--- Quote from: Handoko on June 18, 2021, 05:05:08 pm ---Don't know why OP needs it. If what he wants is showing same components on different tabsheets, I ever done it.

Just set the components' parent to the active tabsheet and put the code in the page control's OnChange event.

--- End quote ---

Hi

I showed the technical solution above.

The reasons for this strange design might be two:

* He wants to show important state information on all different pages

OR

* He wants to draw infos depending on the Tabsheet but he does not want to waste a panel for each page.


Anyway: The easier solution would be to shrink the pagecontrol and put the panel outside the pagecontrol on the form.

But who knows the strange desires if he does not want  to tell us ....

Winni

Navigation

[0] Message Index

[#] Next page

Go to full version