Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

Visual Studio C# Change form background color does not work

(0) ShareShare
ReportReport
Posted on by 75,788 Moderator
I have a very basic VS C# project built on a Dynamics GP windows form. The usual color change code does not work. 
Is there something different that has to be done for a Dynamics GP windows form to change the background color?

private void frmARCreditCheckSummary_Load(object sender, EventArgs e) {     this.BackColor = System.Drawing.Color.Red; }

*This post is locked for comments

  • Tim Wappat Profile Picture
    Tim Wappat 5,703 on at
    RE: Visual Studio C# Change form background color does not work

    I always bring up the example where I got asked to add an "Are you really certain?" to the "Do you want to apply these changes?" dialog.

    Joking suggest I code in an extra layer of "Are you really certain" to click through for each month from a start date, alternating the yes/no ok/cancel etc for each layer to keep them on their toes!

  • Richard Wheeler Profile Picture
    Richard Wheeler 75,788 Moderator on at
    RE: Visual Studio C# Change form background color does not work

    I know but at least I could say I have done all that I can do. This routine does log all of these events so management knows, as best as possible, when this happens and who approved it. I have been looking into how to add electric shock to the effect or perhaps auto-deduction from their paycheck.

  • Tim Wappat Profile Picture
    Tim Wappat 5,703 on at
    RE: Visual Studio C# Change form background color does not work

    ..Or  just stick to the exiting GP UI conventions! 

    I wonder, would it really benefit from the colour? I doubt after the first time it is seen it would, users get blind to no matter now gaudy you make it, or how many have you read this, click to confirms you have, that you put in the app!

  • Richard Wheeler Profile Picture
    Richard Wheeler 75,788 Moderator on at
    RE: Visual Studio C# Change form background color does not work

    Since this is just a warning box about a customer being over their credit limit I will switch to a plain Windows form.

  • Tim Wappat Profile Picture
    Tim Wappat 5,703 on at
    RE: Visual Studio C# Change form background color does not work

    You don't have the control that you get with windows forms on GP forms. You also have to use sanscript - not a pleasant journey.

    Some background reading in the reference section at the end of this post:

    www.timwappat.info/.../test-company-test-database-live-company-in-test-database-test-company-in-live-database%E2%80%A6

    I would go and rethink whatever it is you are trying to achieve, see if there is another way.

  • Verified answer
    Almas Mahfooz Profile Picture
    Almas Mahfooz 11,006 User Group Leader on at
    RE: Visual Studio C# Change form background color does not work

    I can not see any property with the help of which i can change GP window back color to blue,red, green etc. I can only set backcolor = true/false, If false then it has white back ground and with true gray color. So I your form is rendering gp forms properties then may be that's the reason it's not showing color change. I tried this with one VS Tools form and getting color changed.

  • Richard Wheeler Profile Picture
    Richard Wheeler 75,788 Moderator on at
    RE: Visual Studio C# Change form background color does not work

    I see this in the VS Programmer's Guide but I do not see where in the code to change the color.

    AutoSetDexColors

    The AutoSetDexColors property controls whether the colors used for the WinForm

    will automatically match the color scheme selected in the user preferences within

    Microsoft Dynamics GP. Set this property to True to match the Microsoft Dynamics

    GP appearance.

  • Verified answer
    Almas Mahfooz Profile Picture
    Almas Mahfooz 11,006 User Group Leader on at
    RE: Visual Studio C# Change form background color does not work

    I don't think you can change GP window background color like that.

    Edit: I thought you are trying to do so for GP form, my above comment is for GP window. for VS form I am not sure, maybe we have some option.

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,430 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans