Help design anchoring lazarus / 10-Designer ---------------------------------------------------------------------- Leledumbo · 2009-10-14 13:55 From this picture, can anyone give me an advice about the best (or at least good) way to design the anchor? As in the picture, the current state is not very good. For example, the help button size is smaller than the other two (all of them has AutoSize set to true). ---------------------------------------------------------------------- Martin_fr · 2009-10-14 15:33 To have the 3 buttons (help, about,. execute) having the same *width*: Anchor each button as follows: - [akLeft, akRight];   // aktop probably too, depends on how you deal with vertical layout - sibling: either nil, or parent (groupbox)   if you set sibling to nil, then you must initially set the width of all buttons to the width of the parent, and after that turn on autosize (so the right button side will have 0 pixel distance to the parent right edge. the distance will be kept at 0 pixel due to akright) Set buttons and parent to autosize. I have no idea why your buttons have different heights. (You can force height settings via constraints) IMHO autosize buttons, should automatically have the same height. Maybe you can attach the unit + lfm (stripped of any code, you don't want/need to publish)? ---------------------------------------------------------------------- Leledumbo · 2009-10-15 12:47 The width is OK, my problem is with the height. QuoteMaybe you can attach the unit + lfm (stripped of any code, you don't want/need to publish)?I've made it open source, so no need to hide anything. But I forgot to bring the code, I'll post tomorrow. ---------------------------------------------------------------------- Leledumbo · 2009-10-16 07:04 Please see attachment. ---------------------------------------------------------------------- Martin_fr · 2009-10-16 08:35 - The buttons have a different inner border. - help button has it's bottom anchored to about-btn; while about-btn has t's top anchored to help-btn => circular anchor, this may be ignored, - execute-btn has it's bottom aligned to the parent/groubbox => so it can/will be stretched to a different height. - Instead of using any verical anchors, use the parents ChildSizing (remove allanchors for that to work)  clTopToBottomThenLeftTooRight / 3 controls per line  vertical HomogenousSpaceResize  horizental ScaleChilds ---------------------------------------------------------------------- Leledumbo · 2009-10-19 05:32 Thanks, I'll try to follow your guidelines. ---------------------------------------------------------------------- Martin_fr · 2009-10-19 11:34 If you need all group boxes the same height: - put them into a panel. - make the panel autosize (and in your case probably alTop, but that may differ) - make the groupboxes autosize - anchor the group boxes to the panel (top and bottom anchor) ---------------------------------------------------------------------- Leledumbo · 2009-10-22 11:25 It looks much better now. Just one little more problem, about the buttons in the groupbox. How can I make it behave like TCheckGroup or TRadioGroup so that no buttons will be stretched when I resize the TGroupBox? My anchoring scheme doesn't seem to work. ---------------------------------------------------------------------- Martin_fr · 2009-10-22 13:00 Not exactly sure. Try ChildSizing with HomogeneousSPACEResize ? Since your Buttons are top-down/vertical, the trick is to: - Layout = TopToBottomThenLeftToRRight - ControlsPerLine = 3 (or however many you have in the box That way the box knows that the table should be 3 lines heigh and adjusts the vertical spacing => but no longer the horizontal spacing (yet I think you have only one column)