PageControl and its tabsheets events lazarus / 31-LCL ---------------------------------------------------------------------- asdf · 2011-02-07 10:33 1. What are the differences of tabsheet events; OnShow, OnEnter or OnMouseEnter  ? 2. From the attached picture, PageControl is showing TabSheet3.    What event is working with TabSheet4 while it is now 'behind' TabSheet3  ? 3. What is the proper event when user clicks on tab namely TabSheet4  ? ---------------------------------------------------------------------- theo · 2011-02-07 10:40 I don't really understand the questions, but I think you are looking for TPageControl.OnChange. See this example: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i procedure TForm1.PageControl1Change(Sender: TObject);begin  Caption:=PageControl1.ActivePage.Caption;end; ---------------------------------------------------------------------- ringo · 2011-02-08 08:57 OnShow will be fired whenever the tab page is "shown", that is, displayed.  It doesn't matter if it was shown due to a mouse click or programically. OnEnter will be fired when you navigate into the page, whether it is via a mouse click or the tab key or any other means. OnMouseEnter will be fired when to enter the tab page specifically by clicking the mouse. I think Theo probably identified the event you are really looking for. Ringo ---------------------------------------------------------------------- asdf · 2011-02-14 01:53 Quote from: ringo on February 08, 2011, 09:57:21 am OnShow will be fired whenever the tab page is "shown", that is, displayed.  It doesn't matter if it was shown due to a mouse click or programically. Thank you, in design window, I sometimes forgot and saved the project with PageControl.TabIndex <> 0. And for example, in some PageControls, TabIndex(TabSheet)2 has to wait until TabSheet1Show finishes. That's why compiling has error. Now I always put PageControl1.TabIndex:=0 .