>>>Hi Terry,
>>>
>>>Your recommendation sounds great and I understand it. However, I am very new at VFP programming and I would not know how to go about this. I just re-arranged the buttons already the way I wanted it in my container and used that. If I need this again then I guess I will re-create the same buttons with different positions.
>>
>>You can have some code in the container's init, which would just go through the .buttons[] array and calculate the position of each button. You can set any object's .top, .left etc at runtime, they don't need to be set in advance.
>>
>>Something like
>>
>>lnLeft=0
>>for i=1 to this.buttoncount
>> with this.buttons[i]
>> if .visible
>> .left=lnLeft
>> .top=0
>> lnLeft=lnLeft+.width+1
>> endif
>> endwith
>>endfor
>>
>>This would align visible buttons in one line. You could add similar code for the two row case (lnTop would be there, zero for 1st row, .height+1 for 2nd). You could have a property on the container which would indicate in how many rows does it go, then consult this property before running this code (in container's init). You'd only have to set that property for the container in those forms where it should have a non-default value.
>
>What .Buttons array? This is a container, not specifically a buttons container.
Ah, .objects then. The .buttons would apply to an optionbuttongroup or commandbuttongroup (or whatever they are called).