Forum > LCL

NBPages in TabControl... what for?

(1/3) > >>

polpero:
Hi

I'm trying to maximise usage of the TTabControl...

I've setup a TabControl and a TMemo to load various text files
adding a new tab for each file...

I thought that I could use pages.text (NBCustomPage)
to buffer the content of the TMemo when not selected (tabIndex)
but it doesn't seem to work that way?

What is the purpose of TNBPages in the TabControl?
Are there any demos/docu on the subject?

Thanks

jamie:
its more of a runtime thing.

If you add a page to pages, then it has a page attached to the stretched down page of the Tab control.

 using the TabToPage or PageToTab functions you can link them,
 
 Also, using PAGE[index] will give you the Page control, from that I believe you can add items to it as child controls etc.

  That is what i got out of it from playing around.

  The problem is that you can have more pages than tabs so its possible to link specific pages to tabs etc

polpero:
Ok
Thanks for giving it a look...

Now try to load (pages.loadFromFile() ) a text file...
it looks like each line of text becomes a page!

and trying to load back the content of Pages to the TMemo 
( memo.text := pages.text or memo.lines.assign( pages.text ) )
doesn't work

So it got me wondering what is it meant for?
What should NBPages' purppose be?

KodeZwerg:
TabControls properties have nothing to do with its controls inside.
When you want to load something to a memo, use memo's load method.

Bart:

--- Quote from: polpero on March 19, 2023, 01:43:11 pm ---Hi

I'm trying to maximise usage of the TTabControl...

I've setup a TabControl and a TMemo to load various text files
adding a new tab for each file...

--- End quote ---

Probably better use a TPageControl for that.
Add TTabSheets as needed and put the TMeme's on those.

Bart

Navigation

[0] Message Index

[#] Next page

Go to full version