Forum > LCL

TPageControl - "owner draw"


Coming from Delphi, Lazarus complains, "I do not know owner draw".

I used this ownerdraw to color PageControl-tabs in series to group them.
Is there a way to color a TPageControl tab? To Group them?

I found, that I can decorate them by small images, which is nice. Never the less a "group-them-color" would be quite helpful, the moment there are many tabs.


--- Quote from: Nicole on August 05, 2022, 05:32:59 pm ---Is there a way to color a TPageControl tab?

--- End quote ---

As far as I know no. Alternatively, you can try:

Thank you for your answer and this link.
I read it and read it again and I am aware, there should be explained, what I need to know.
But I do not get it.

These frames, this is exactly what I need.
At the moment, I work with parent and it is no fine working.
Unfortunately, I need these frames interacting with each other. So I need to address them.

Will this be easier or harder by ATTabs?

First of all, I don't see any benefit of using a TFrame and set a tabsheet as the frame's parent. Instead I use TForm and this is my code:

--- 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.Button1Click(Sender: TObject);var  NewTab: TTabSheet;  SubForm: TSubForm;begin  SubForm             := TSubForm.Create(Self);  NewTab              := PageControl1.AddTabSheet;  NewTab.Caption      := SubForm.Caption;  SubForm.Parent      := NewTab;  SubForm.Align       := alClient;  SubForm.BorderStyle := bsNone;  SubForm.Show;end;
TSubForm is a normal form but I have customized its appearance and added some buttons. So all the tabs will have some similar appearance and buttons.

--- Quote from: Nicole on August 05, 2022, 06:49:45 pm ---At the moment, I work with parent and it is no fine working.

--- End quote ---

Please provide a compilable demo so I can download, test and understand the problem.

Thank you so much for the offer!
But - this would be a work of a week for you.

I have a huge project in Delphi XE3, which works with Frames. Many frames.
About 10 years I put every new idea or feature into a new frame, - they summed up.
So I need a way to re-use these frames (and drop some of them).

Why I "cannot" send it: I used elements heavily which are not in Lazarus: FireDAC, TMS, TChart Pro.
So every single line is a problem. I can only import frame by frame to my new Lazarus thing.

So the Frames exist already.
But as I have so many troubles with them:
Is it better to work with Subforms?
If the advantages are there, I do this change.

The reason, why I worked with frames is organization. Every frame is rather of a huge functionality.

What I need is something like this:
Frame13 must be able to adresse every variable of Frame4 etc. They interact.


[0] Message Index

Go to full version