Article ID: 160773
Article Last Modified on 5/10/2003
** Code to demonstrate that when a custom class object is
** added to a Group type class the properties of that
** custom class object revert to the its default values.
**
** The code in this program could also be entered
** through the Command window.
**
** test.prg
LOCAL aobj[1], xx
CREATE CLASS optbut AS optionbutton OF test.vcx NOWAIT
=ASELOBJ(aobj,1) && Get an object reference
xx = aobj[1]
xx.Caption='custom' && Demonstrate that it's custom
KEYBOARD 'Y' CLEAR && Avoid the dialog box - save class
RELEASE WINDOW 'Class Designer'
SET CLASSLIB to test
CREATE CLASS optgrp AS optiongroup OF test.vcx NOWAIT
=ASELOBJ(aobj,1) && Get another object reference
xx = aobj[1]
xx.Height=xx.Height*1.5 && See that you actually ran it
xx.AddObject('opt1','optbut') && Add custom class object
KEYBOARD 'Y' CLEAR
RELEASE WINDOW 'Class Designer'
MODIFY CLASS optgrp OF test.vcx NOWAIT
** The caption of the third option button has reverted to the default.
** This problem also occurs with the Command Button group.
** You can examine the Optbut class of Test.vcx with the
** MODIFY CLASS optbut OF Test.vcx to see that it still has
** the customized caption property.
Keywords: kbbug kbprogramming KB160773