Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Navigation Buttons in Container
Message
From
13/12/2006 05:55:23
 
 
To
12/12/2006 14:14:48
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 6
OS:
Windows 2000 SP4
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01176887
Message ID:
01177107
Views:
14
>>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   && one pixel gap, if you like
>      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.
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform