Hi again Varden,

I am sorry for being so late replaying your message.
Thanks you for your help. I just tried the solution you sent me but 
there is a problem in it.

It only returns the main containers on the form not the controls.
Is There any way that I can get all the controls in a container??

Thanks again for your help

Best Regards,



--- In Axapta-Knowledge-Village@yahoogroups.com, Varden Morris 
<[EMAIL PROTECTED]> wrote:
> I think I have found your solution. On a form the following code 
displays the names of all the controls and also set the visible 
properties of all the controls to false.
>  
>     int i;
> 
>     for (i=1;i<= element.design().controlCount();i++)
>         {
>             info(strfmt('%1', element.design().controlNum(i).name
()));
>             element.design().controlNum(i).visible(false);
>         }
> 
> Varden Morris <[EMAIL PROTECTED]> wrote:
> I think I understand what you are saying. Here is another way you 
may access a control on a form without setting the autodeclaration 
property to yes:
>  
> 
> FormWindowControl MyControl;
> 
> ;
> 
> MyControl = element.design().control(control::Accountnum);
> 
> MyControl is now a handle to the control with the name Accountnum. 
I am not sure if there is any way you may use code to loop through 
the control set by using element.design().control but you can do some 
experiment or research.
> 
>  
> 
> Varden Morris
> Senior Developer
> WellPoint Systems Inc.
> Suite 2000, 500 - 4th Ave SW
> Calgary, Alberta, Canada 
> T2P 2V6
> 
> (403) 444-5848 direct
> (403) 444-3900 main
> www.wellpoint.ca
> 
> 
> 
> eng_mollar <[EMAIL PROTECTED]> wrote:
> Thank you for your replay.
> my problem is :
> I don't know the controls names.
> The code I want to add will be applied to many forms so i need a 
> generic code to loop on the form controls.
> 
> In C# or Delphi that was easy as there is an array of controls in 
> each form that I can access all controls using for loop.
> 
> Is there any thing like that in Axapta (X++)
> 
> Thanks alot for your consern
> 
> Best Regards,
> Eng. Mollar B. Agaiby
> Senior Developer
> 
> 
> 
> --- In Axapta-Knowledge-Village@yahoogroups.com, Varden Morris 
> <[EMAIL PROTECTED]> wrote:
> > 
> > One way to access a control on a form is to set the Autodeclare 
> property to yes. You may then access the control by using its name.
> > 
> >  
> > 
> > Varden Morris
> > 
> > Senior Developer
> > 
> > WellPoint Systems Inc.
> > Suite 2000, 500 - 4th Ave SW
> > Calgary, Alberta, Canada 
> > T2P 2V6
> > 
> >  
> > 
> > (403) 444-5848 direct
> > 
> > (403) 444-3900 main
> > 
> > www.wellpoint.ca
> > 
> > 
> > eng_mollar <[EMAIL PROTECTED]> wrote:Hi All,
> > Iam very new to Axapta & X++ code and I need some help.
> > 
> > I want to add some code in a form to run when the user opens the 
> form.
> > so I used the run method to do so but the problem is:-
> > 
> > The code I want to add makes changes to all the controls on the 
> form 
> > so, I need to access all the controls' handles and I couldn't do 
so.
> > 
> > I couldn't get access to any control on the form.
> > Can any one help me??
> > I want to add some code to loop on all th form controls and get 
> their 
> > handle
> > 
> > thank you
> > 
> > Best Regards
> > 
> > 
> > 
> > 
> > Sharing the knowledge on Axapta. 
> > 
> > 
> > 
> > SPONSORED LINKS 
> > Axapta Business finance course Business finance online course 
> Business finance class Business finance schools Business finances 
> > 
> > ---------------------------------
> > YAHOO! GROUPS LINKS 
> > 
> > 
> >     Visit your group "Axapta-Knowledge-Village" on the web.
> >   
> >     To unsubscribe from this group, send an email to:
> >  [EMAIL PROTECTED]
> >   
> >     Your use of Yahoo! Groups is subject to the Yahoo! Terms of 
> Service. 
> > 
> > 
> > ---------------------------------
> > 
> > 
> > 
> > 
> >             
> > ---------------------------------
> >  Start your day with Yahoo! - make it your home page
> 
> 
> 
> 
> Sharing the knowledge on Axapta. 
> 
> 
> 
> ---------------------------------
> Click here to donate to the Hurricane Katrina relief effort. 
> 
> Sharing the knowledge on Axapta. 
> 
> 
> 
> SPONSORED LINKS 
> Axapta Business finance course Business finance online course 
Business finance class Business finance schools Business finances 
> 
> ---------------------------------
> YAHOO! GROUPS LINKS 
> 
> 
>     Visit your group "Axapta-Knowledge-Village" on the web.
>   
>     To unsubscribe from this group, send an email to:
>  [EMAIL PROTECTED]
>   
>     Your use of Yahoo! Groups is subject to the Yahoo! Terms of 
Service. 
> 
> 
> ---------------------------------
> 
> 
> 
> 
> Varden Morris
> Senior Developer
> WellPoint Systems Inc.
> Suite 2000, 500 - 4th Ave SW
> Calgary, Alberta, Canada 
> T2P 2V6
> 
> (403) 444-5848 direct
> (403) 444-3900 main
> www.wellpoint.ca
> [EMAIL PROTECTED]
>               
> ---------------------------------
>  Click here to donate to the Hurricane Katrina relief effort.




------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get fast access to your favorite Yahoo! Groups. Make Yahoo! your home page
http://us.click.yahoo.com/dpRU5A/wUILAA/yQLSAA/kGEolB/TM
--------------------------------------------------------------------~-> 

Sharing the knowledge on Axapta. 
Yahoo! Groups Links

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

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

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


Reply via email to