Author Topic: Copied BasicButton Backcolor reverts to previous color in design form  (Read 1766 times)

scott.clark

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
Visual Studio Express 2013,  AdvancedHMI v3.99a

If I create a BasicButton(BasicButton1) on a form, I can change the BackColor.   But then if I copy that button, creating a new instance(BasicButton2) , and then change the BackColor of the new  instance(BasicButton2), then the new  instance(BasicButton2) reverts back to the originally created (BasicButton1) BackColor after a build or test run.

 But then if I close the solution and visual studio, then start visual studio and the solution, the Backcolor for BasicButton2 returns to the last BackColor I set.

What could be going on?.  It slows down the programming process?.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Copied BasicButton Backcolor reverts to previous color in design form
« Reply #1 on: October 16, 2015, 07:13:43 PM »
I'm having trouble replicating this. This is what I am doing:

- Add a BasicButton to the form
- Set the BackColor to DimGray
- Click once to select the BasicButton1
- Ctrl-C
- Ctrl-V
- Set the Back color of BasicButton2 to Maroon
- Run the application
- Exit VS
- Re-open

The 2 buttons maintain their BackColor

Do you by any chance have the Property Highlight set to True?

scott.clark

  • Jr. Member
  • **
  • Posts: 96
    • View Profile
Re: Copied BasicButton Backcolor reverts to previous color in design form
« Reply #2 on: October 20, 2015, 09:04:25 AM »
No, Property Highlight is set False.

So I started with with a fresh copy of AdvancedHMI v3.99a and did not see the issue

-open fresh copy of AdfvancedHMI v3.99a
- Crtl+shift+B
- drag BasicButton to MainForm.vb
- Ctrl +c
- ctrl +v
- change BackColor from Grey to Maroon
- Run application (Maroon button displayed)
- Exit application (Maroon button still shown in MainForm(Design))

However in the application I started last week,  also started with a fresh copy of AdvancedHMI v3.99a, I see the issue.
After stopping the application, on the MainForm(Design) the copied BasicButton BackColor reverts back to the previous grey color.  But then if I close the MainForm and reopen the MainForm it updates to the desired BackColor as Maroon and the Property Panel shows it as Maroon.

Then I copied the BasicButton from the offending application to the fresh test application... no issues.   Seems to be a visual studio issue I can't explain.  I am will recreate the application scratch and see if the issue returns, I can identify what change affected it.

Thanks for the feedback.


bachphi

  • Hero Member
  • *****
  • Posts: 671
    • View Profile
Re: Copied BasicButton Backcolor reverts to previous color in design form
« Reply #3 on: October 20, 2015, 11:34:09 AM »
If you created a new window application, and grab a regular window button, the default backcolor is control.

However, in AAHMI solution, creating a regular button , the default backcolor is black and yet it did not display black, but rather Gainsboro color!
===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Copied BasicButton Backcolor reverts to previous color in design form
« Reply #4 on: October 20, 2015, 05:48:02 PM »
If you created a new window application, and grab a regular window button, the default backcolor is control.

However, in AAHMI solution, creating a regular button , the default backcolor is black and yet it did not display black, but rather Gainsboro color!
I am unsure of why this is, but if you change the BackColor of your form, a new Button you add will acquire that same Backcolor