************************************************** *-- Class: vsadegrp (c:\dev\common\classes\vs.vcx) *-- ParentClass: vsgrp (c:\dev\common\classes\vs.vcx) *-- BaseClass: commandgroup *-- Time Stamp: 06/05/98 10:50:05 AM * DEFINE CLASS vsadegrp AS vsgrp && use your own base comandgroup class here ButtonCount = 3 Height = 25 Width = 160 Name = "adegrp" Command1.Top = 0 Command1.Left = 0 Command1.Height = 19 Command1.Width = 48 Command1.Caption = "Add" Command1.Name = "Command1" Command2.Top = 0 Command2.Left = 49 Command2.Height = 19 Command2.Width = 48 Command2.Caption = "Delete" Command2.Name = "Command2" Command3.Top = 0 Command3.Left = 98 Command3.Height = 19 Command3.Width = 48 Command3.FontSize = 8 Command3.Caption = "Edit" Command3.Name = "Command3" PROCEDURE Init DoDefault() LOCAL n, nCnt n= 0 nCnt= 0 * only allow for visible buttons in layout this way you can turn buttons off simply by making them visible= .F. You can also add other buttons at design time. 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 ENDPROC ENDDEFINE * *-- EndDefine: vsadegrp **************************************************Regards