Close all but one tab. - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Close all but one tab.

Dennis445Dennis445 Posts: 2Member
I have a page control on my main form that gets its tabs populated
form from a frame this all works great I have a popup menu that give the user an option to free a single tab or all the tabs except the welcome tab (this doesn't work).

Heres what I have for code:

[color=Green]for iPage := 0 to PageControl1.PageCount - 1 do
pagecontrol1.Pages[iPage].free;[/color]

On another note how can I prevent the same form being opened in a tab
multiple times.

Heres what I have for that"

[color=Green]i := 'AdminMain';
for iPage := 0 to co.PageControl1.PageCount - 1 do
if i = co.pagecontrol1.Pages[iPage].caption then
Form2.show[/color]
Sign In or Register to comment.