Hi James 

Yes it is Possible to change the background Color of the Forms according to the 
company u have..

Try this out.

Add a field- color (integer type) , in the table CompanyInfo
give some values (ex -255)

 and add the following codes in the class 
SysSetupFormRun

public void run() 
{ 
    FormDesign  formDesign = this.design(); 
    container   con; 
    ; 
    #WinAPI 
    super (); 

    if (FormDesign) 
    { 
        FormDesign.colorScheme(2); 


        if(CompanyInfo::find().Color != 0) 
        { 
            FormDesign.backgroundColor(CompanyInfo::find().Color); 
        } 
        else 
        { 
            con = winapi::getSysColor(#COLOR_BTNFACE); 
            FormDesign.backgroundColor(winapi::RGB2int(conpeek(con,1), 
conpeek(con,2), conpeek(con,3))); 
        } 
        FormDesign.caption(CompanyInfo::find().Name); 
    } 

}

1. login in to the company accounts open AOT and open table browser for 
CompmanyInfo Table and give some values for the field "color" eg(255)
2. then log in with another company and repeat the above step

Check the difference

Cheers 
Raghuram

My Blog - http://raghuzz.spaces.live.com









11:50 AM | Add a comment | Read comments (1) | Send a message | Permalink | 
View trackbacks (0) | Blog it
  ----- Original Message ----- 
  From: Malcolm Burtt 
  To: Axapta-Knowledge-Village@yahoogroups.com 
  Sent: Wednesday, July 09, 2008 4:45 PM
  Subject: RE: [Axapta-Knowledge-Village] Changing window color



  Hi James



  If you're thinking of changing the workspace background colour of Axapta's 
MDI then no, I don't think that's possible. What you can do is change the form 
background colour based on the company that form is referencing. You'd 
implement that by changing the run method of the SysSetupFormRun class.



  e.g.



  public void run()

  {

      super();

      this.design().colorScheme(formColorScheme::RGB);

      this.design().backgroundColor(Winapi::rgb2int(255,0,0));

  }



  This will change the form's background to a nasty bright red. You'll just 
need to modify the company setup form and related table to add a new field that 
allows the user to select the colour for that company and then implement some 
code in SysSetupFormRun that sets the colour based on that new field.#



  Regards





  Malcolm Burtt

  Touchstone Group

  People - Partnership - Solutions







  From: Axapta-Knowledge-Village@yahoogroups.com [mailto:[EMAIL PROTECTED] On 
Behalf Of James Flavell
  Sent: 09 July 2008 11:12
  To: Axapta-Knowledge-Village@yahoogroups.com
  Subject: [Axapta-Knowledge-Village] Changing window color



  I think this might have been asked already but I cannot find any answer:



  Can I change the background/window color depending on which company I am in?

  This is for ax 4.0



  Thanks

  James





   

Reply via email to