Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to make cmdgrp buttons horizonal not vertical stack
Message
From
19/02/1999 16:52:47
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00189262
Message ID:
00189530
Views:
8
>Thanks, George. I KNEW it was simple.
>
>Marie

In addition to that Marie, you can put code in the init event of the commandgroup (not the individual buttons) which automatically sizes and spaces your buttons for you so you don't have to fiddle at design time.
Here's an example that I sometimes use...
** Command Group Init Event Code
* Sizes all visible buttons to match the size of the command group container...
DoDefault()
LOCAL n, nCnt
n= 0
nCnt= 0
* only allow for visible buttons in layout
FOR EACH oCmd IN THIS.Buttons
	IF m.oCmd.visible
		nCnt= m.nCnt + 1
	ENDIF
ENDFOR

FOR EACH oCmd IN THIS.Buttons
	IF oCmd.visible
		oCmd.Top= 0
		oCmd.Height= THIS.Height
		ocmd.Width= INT((THIS.width-m.nCnt)/m.nCnt)
		oCmd.Left= (oCmd.width+1) * m.n
		n= m.n + 1
	ENDIF
ENDFOR
THIS.borderStyle= 0
Hope this gives you some ideas
Regards
Previous
Reply
Map
View

Click here to load this message in the networking platform