A way to determine the control type is as follows


private
void
    ProcessButtonPress
    (
        FormControl                         Control
    )
{
    ;

    if (Control) {
        switch (Control.handle())
        {
            case    ClassNum(FormButtonControl):
                        Break;
            Default:
                        Break;
        }
    }
}




-----Original Message-----
From: Jens Fudge [mailto:[EMAIL PROTECTED]
Sent: Friday, 5 March 2004 5:17 AM
To: [EMAIL PROTECTED]
Subject: RE : RE : [development-axapta] deleting controls on a form






typeOf method is what I'm looking for. In Delphi it's called an is-operator
(if control is checkbox), but that didnt work here.

but thanks for the input anyway.

/Jens




                      "Steeve Gilbert"

                      <[EMAIL PROTECTED]        To:
<[EMAIL PROTECTED]>                                   
                      -franc.com>                cc:

                                                 Subject:  RE : RE :
[development-axapta] deleting controls on a form             
                      04-03-2004 15:31

                      Please respond to

                      development-axapta







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
      To visit your group on the web, go to:
      http://groups.yahoo.com/group/development-axapta/
<http://groups.yahoo.com/group/development-axapta/>

      To unsubscribe from this group, send an email to:
      [EMAIL PROTECTED]

      Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



    _____ 

Yahoo! Groups Links


*      To visit your group on the web, go to:
http://groups.yahoo.com/group/development-axapta/
<http://groups.yahoo.com/group/development-axapta/>
 

*      To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>
 

*      Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service
<http://docs.yahoo.com/info/terms/> .






This email contains information from G&S Engineering Services Pty Ltd, G&S
Services Electrical Pty Ltd or BIGmate Monitoring Services Pty Ltd (the G&S
Group) that may be confidential and/or priviledged and/or contain
information which may only be disclosed with the consent of the individual
concerned pursuant to the Privacy Act 1988. Only the intended recipient may
access or use the information. If you are not the intended recipient, please
delete this email and notify the G&S Group immediately.  Please advise
immediately if you or your employer does not consent to Internet email for
messages of this kind. Opinions, conclusions and other information in this
message that do not relate to the official business of the G&S Group shall
be understood as neither given nor endorsed by G&S.


[Non-text portions of this message have been removed]





Yahoo! Groups Sponsor
ADVERTISEMENT
click here


Yahoo! Groups Links

Reply via email to