[Resolved] TFrame size lazarus / 31-LCL ---------------------------------------------------------------------- iru · 2012-05-19 16:24 Gentlefolk, The environment is Win XP SP-3, Laz, 0.9.30.4. I have a main form with a Frame on it. I have added a tFrame.Create which gets executed as the program starts up. In Create code after an Inherited Create I have code to adjust the width and height of the frame. For other reasons I have a tFrame.SetBounds which adjusts the size of the frame. This is executed after the tFrame.Create. In both cases the size of the tFrame us UNCHANGED from the original design time settings. Any help appreciated, Ian. ---------------------------------------------------------------------- Blaazen · 2012-05-19 16:44 @ In both cases the size of the tFrame us UNCHANGED from the original design time settings. Both cases ... Do you mean regardless of SetBounds ? Anyway, your chance is create TFrame later, for example in OnActivate (but of course only once). ---------------------------------------------------------------------- iru · 2012-05-19 19:45 Gentlefolk, Yes, on both the Create and the SetBounds no change is made to the size of the Frame. How do I create/setup the Frame later in the OnActivate if it is allready created somewhere back in the initialisation/creation of the application/mainform. Ian ---------------------------------------------------------------------- Blaazen · 2012-05-19 20:17 You can try it. Move all the TFrame.Create related code to OnActivate event. On the end of the event add: OnActivate:=nil; (It makes that OnActivate is raiased only once) ---------------------------------------------------------------------- marcov · 2012-05-20 07:49 Do you set size before or after setting the parent? ---------------------------------------------------------------------- iru · 2012-05-20 17:03 Gentlefolk, I will have a good look at moving code to the OnActivate code. I have not set the parent. I thought that would have been set in the IDE by placing the tFrame on the main form of the program. Will also try that. Thanks, Ian ---------------------------------------------------------------------- iru · 2012-05-22 12:50 Gentlefolk, Had a look at the suggestions, set the parent, etc. No change. Created a new project, one form and added the tFrame. Can change the size of the Frame in the tFrame.Create, works OK. In the project with the tFrame problem The tFrame was the fifth object added to the main form, three group boxes a tStringGrid in one groupBox and a menu system (with a couple of items coded). Changed the TAB order, putting the Frame first, no change. Starting to delete the GroupBoxes to see what happens. Stay tuned, it may take some time as other things ae chewing up my time. Ian ---------------------------------------------------------------------- iru · 2012-05-25 14:17 Gentlefolk, Deleted the GroupBoxes and related code one by one. With no groupboxes I could change the size of the TFrame. Re-inserted groupboxes one by one. No problem, could change the size of the TFrame. A close examination of my mainform and TFrame showed that I done something ugly to a groupbox inside the TFrame rather than to a groupbox on the main form (similar names). This was providing a constant display size in the TFrame. Once again outsmarted myself........ Thanks for the support, Ian