I've done the same with reports.  I've added controls dynamically with the same name and it seems to work too.  But I haven't tried to access them afterwards.  Maybe you can find a function like "typeof" that would tell you what's the type of the control instead of basing the choice on the name.

Steeve...

-----Message d'origine-----
De�: Jens Fudge [mailto:[EMAIL PROTECTED]
Envoy�: 4 mars 2004 05:27
��: [EMAIL PROTECTED]
Objet�: RE : [development-axapta] deleting controls on a form





Steeve...

Thanks a lot for your input.

You are right, that could in fact be a way of doing this, however I have
chosen another path.
One of the reasons for choosing another path, is that I want to learn how
to build and use dynamic forms. A thing that I find is quite difficult in
Axapta, compared to my normal programming environment, Delphi.

Anyway, in stead of deleting the controls, I just hide them with there
visible property. The drawback here is that the checkboxes and radiobuttons
still reside in memory, and are not released until the form is closed (I
gather that the garbage collector releases all controls on a form).

To find the controls, I do infact use the controlCount method of the
design, and I do in fact iterate through all controls in a for-loop.
Unfortunatly I cannot seem to be able to figure out what type a given
control is. In the for-loop I get all staticTexts as well as all
checkboxes.
To solve this I give each checkbox a name ('Check'), and compare by the
name and the visibility method. The thing that puzzles me here is that I
actually give all checkboxes the same name, and this seems to work.....

Thanks for your input.

/Jens

Yahoo! Groups Sponsor
ADVERTISEMENT


Yahoo! Groups Links

Reply via email to