Page Control's Close Button Root › Technical support › Tricks This topic has 6 replies, 2 voices, and was last updated 10 years, 9 months ago by mboloz. Viewing 7 posts - 1 through 7 (of 7 total) Author Posts January 29, 2014 at 10:12 am #36016 mbolozParticipant Hello there, need help i have TsPageControl with properties ShowCloseBtns True, then i make docked form into it, so the number of the page is random just like this… What i want to ask , with a single button i palce outside the PageControl, how i can clicked all active page one by one using looping? i just tried this one not even work Code: for i:=0 to pg.PageCount-1 do begin pg.CloseClick(pg.ActivePage); end; Thanks, Regard January 29, 2014 at 12:13 pm #51479 SupportKeymaster Maybe this code will work: Code: for i := pg.PageCount-1 downto 0 do begin pg.CloseClick(pg.Pages); end; Can you show a demo? Why you clicks on buttons in the loop, but not closing pages directly? January 30, 2014 at 2:39 am #51492 mbolozParticipant That code not work, i just got AV emm, i just want to make design like browser+desktop feel, and those single button work like logout, so user no need to close one by one here just the example i have made, if something wrong please correct it January 30, 2014 at 7:18 am #51494 SupportKeymaster Thank you Try this code: Code: for i := pg.PageCount-1 downto 0 do begin DeletePage(TsTabSheet(pg.Pages)); end; January 30, 2014 at 7:26 am #51496 mbolozParticipant 'Support' wrote: Thank you Try this code: Code: for i := pg.PageCount-1 downto 0 do begin DeletePage(TsTabSheet(pg.Pages)); end; Hay Thanks too… I Tried those code, but there still 1 form left in the docked.. and what i wanted is to close All the docked From Would You Fixed it please January 30, 2014 at 7:33 am #51497 SupportKeymaster This code should close all pages: Code: for i := pg.PageCount – 1 downto 0 do pg.Pages.Free; January 30, 2014 at 7:38 am #51498 mbolozParticipant 'Support' wrote: This code should close all pages: Code: for i := pg.PageCount – 1 downto 0 do pg.Pages.Free; 😀 Many Thanks, Work like charm.. let's me try on my application.. Best Regard Author Posts Viewing 7 posts - 1 through 7 (of 7 total) You must be logged in to reply to this topic. Log In Username: Password: Keep me signed in Log In Root › Technical support › Tricks