Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Answered

Accessing Dynamics GP Colors for a Windows Form

Posted on by 409

Is there a way to access (or assign) a component a color from the Dynamics GP pallet of colors? I have a windows form that inherits DexUIForm and includes the dexDefaultColorsProvider component. I have added a panel to the form and would like to assign the background color to match one of the GP colors. There is no Dexterity section in the properties of the Panel. Is there a way in code to pull a color from the GP color provider?

Categories:
  • David Musgrave MVP GPUG All Star Legend Moderator Profile Picture
    David Musgrave MVP ... 13,915 Most Valuable Professional on at
    RE: Accessing Dynamics GP Colors for a Windows Form

    Hi Craig

    Note this will only work for a customer with GP Power Tools build 29 (once it has been released).

    Please contact me using the Contact Us page on https://www.winthropdc.com/contact.htm

    David

  • Craig Fuller Profile Picture
    Craig Fuller 409 on at
    RE: Accessing Dynamics GP Colors for a Windows Form

    Yes sir, that would be great!

  • David Musgrave MVP GPUG All Star Legend Moderator Profile Picture
    David Musgrave MVP ... 13,915 Most Valuable Professional on at
    RE: Accessing Dynamics GP Colors for a Windows Form

    If you want to test out the functions. I can provide a link to the Build 29 beta code that as of today now contains those functions.

  • Craig Fuller Profile Picture
    Craig Fuller 409 on at
    RE: Accessing Dynamics GP Colors for a Windows Form

    Wow. Thank you David for those new functions and for all the other tools and knowledge you continue to share.

  • Suggested answer
    David Musgrave MVP GPUG All Star Legend Moderator Profile Picture
    David Musgrave MVP ... 13,915 Most Valuable Professional on at
    RE: Accessing Dynamics GP Colors for a Windows Form

    Hi Craig

    So....

    I confirmed that it is not possible to get the colours currently in use from Dexterity.  It only has the ability to set the colours for the colour themes and not to get them.

    However, in most cases, the custom colours are because the site has GP Power Tools installed.

    So I have added two functions specifically so that you can get the colours currently in use by GP Power Tools. 

    Added MBS_CompanyColorGet and MBS_CompanyColorGetRGB functions which can be by VSTools applications to get the current company colours being used as numeric values or RGB values.

    These functions will be in the upcoming Build 29 and can be accessed by adding a reference to the Application.GpPowerTools.dll Dictionary Assembly.

    Regards

    David

  • Verified answer
    David Musgrave MVP GPUG All Star Legend Moderator Profile Picture
    David Musgrave MVP ... 13,915 Most Valuable Professional on at
    RE: Accessing Dynamics GP Colors for a Windows Form

    Hi Craig

    GP Power Tools has the ability to change the colours of Dexterity windows on a per company basis as part of the Administrator Tools module.

    I know that VSTools Winforms don't match the colours used by GP once GP Power Tools changes the colours.

    I am working on a new build of GP Power Tools at the moment, it might be possible to add an API for you to get the colours (RGB) so you can update your window and controls to match.

    Even without an API, pass through Dexterity should be able to get the values. However, passing the values back to VSTools requires some tricks to pass the values back and forth as string variables.

    I like the idea of an API for you to get the current colours that you can call when you open a Winform window. I will see about adding it to the upcoming Build 29 release.

    Regards

    David

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,240 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans