AndrewMozley
Programmer
I have subclassed several controls, command buttons, text boxes, labels &c. and have subclassed the standard form as amform.
When amform is re-sized at run time it visits all the controls of the form and re-calculates their position, size and fontsize. In general this works fine. In the case of a grid, subclassed as amgrid, this itself has a resize() method. When this is called (as a result of the form re-sizing) this visits each of its columns and adjust its width. This also works OK.
However I have a difficulty with the option group (subclassed as amoption).; when this is re-sized, I would like it to visit each of its option buttons and re-calculate its Top and Width properties; this is based on the current scaling of the form and on the original values of Top and Width for the button, which I would like to save as properties of the option button.
To that end I believe that I need to subclass the option button (as ambutton) and give it these two additional properties. However I do not know how to include these subclassed buttons (ambutton) in my subclassed option group (amoption). When the button count on amoption is altered at design time, it creates extra buttons as class optionbutton, rather than as my subclassed ambutton.
I see that there has been previous discussions on this matter on this site - I am probably attempting something which has been done many times before, or perhaps over-complicating the issue - but would be grateful for guidance.
When amform is re-sized at run time it visits all the controls of the form and re-calculates their position, size and fontsize. In general this works fine. In the case of a grid, subclassed as amgrid, this itself has a resize() method. When this is called (as a result of the form re-sizing) this visits each of its columns and adjust its width. This also works OK.
However I have a difficulty with the option group (subclassed as amoption).; when this is re-sized, I would like it to visit each of its option buttons and re-calculate its Top and Width properties; this is based on the current scaling of the form and on the original values of Top and Width for the button, which I would like to save as properties of the option button.
To that end I believe that I need to subclass the option button (as ambutton) and give it these two additional properties. However I do not know how to include these subclassed buttons (ambutton) in my subclassed option group (amoption). When the button count on amoption is altered at design time, it creates extra buttons as class optionbutton, rather than as my subclassed ambutton.
I see that there has been previous discussions on this matter on this site - I am probably attempting something which has been done many times before, or perhaps over-complicating the issue - but would be grateful for guidance.