Curious behaviour of checkbox in tabsheet lazarus / 31-LCL ---------------------------------------------------------------------- DL4OCE · 2014-01-22 13:01 Hi, I have a 7 TabSheets that can be switched by a PageControl which works great. Now I have added two CheckBoxes with exactly the same properties except checked, left and width and name, of course. One of the CheckBoxes will only be visible when the according TabSheet is shown. The other one is being shown all the time. They are both in the same TabSheet container, and even the formular source file says they are pretty similar one to another. I already tried to delete the CheckBox and insert a new one with the same name. But, hey, that would have been too easy.. Any clue? ---------------------------------------------------------------------- howardpc · 2014-01-22 14:10 Quote from: DL4OCE on January 22, 2014, 02:01:17 pmI already tried to delete the CheckBox and insert a new one with the same name. But, hey, that would have been too easy.. Are you saying you can't delete an unwanted checkbox in the Designer? Have you tried selecting it, right-clicking and choosing Delete Selection? Or have you dropped a checkbox within an 'empty' pagecontrol (before you added any tabsheets to it)? Such a dropped control actually has no connection to the pagecontrol. It just happens to be placed on the form where a pagecontrol is also displaying its tabsheets. It is parented by the form, and shows through the pagecontrol 'surrounding' it. It will show at runtime whatever tabsheet is showing, but of course will obscure anything on the current tabsheet in the checkbox's area (if anything is there). That would be very poor GUI design, IMO. Where do you want to position your checkbox that is always visible - within the area of the pagecontrol? If so, a good way to do that is to drop a checkbox somewhere out of the way on your form. Call it cbEverVisible, and then add form OnCreate and pageControl OnChange event handlers like so: Code: [Select]procedure TForm1.pageControl1Change(Sender: TObject); begin   cbEverVisible.Left:=10; //set these to appropriate values   cbEverVisible.Top:=10; //set these to appropriate values   cbEverVisible.Parent:=pageControl1.Pages[pageControl1.ActivePageInde x]; end; procedure TForm1.FormCreate(Sender: TObject); begin   pageControl1Change(nil); end; ---------------------------------------------------------------------- DL4OCE · 2014-01-22 14:35 Thanks for the quick reply. I tried deleting it and creating a new one at the same position with the name and so on to be sure nothing got mixed up in the IDE. I've also thought of setting the parent property, already, but did not know which one has to be the parent. Thanks for pointing me into that direction! Actually I'd thought that the object inspector showed me the right parent which has been TTabSheet7 for both the working and the non- working CheckBox all the time. Btw, setting it's parent manually at run-time did not help. To tell you what I mean: the CheckBox is drawn on whichever TabSheet is active and I do NOT want it to behave this way. I ONLY want it to show when the certain TabSheet is selected, just as you would propably do it What else can I try? ---------------------------------------------------------------------- DL4OCE · 2014-01-22 14:45 Please forget what I've written. The behaviour is back to normal as expected, thread can be closed.