Author Topic: Message Display By Value  (Read 3381 times)

Phrog30

  • Guest
Message Display By Value
« on: May 12, 2017, 02:01:21 PM »
I created a quick 6 "state" display. In the message collection I defined the fore and back color differently.  When in design mode and I write to value, the colors work, except for the first member, the forecolor goes from the text forecolor.  During runtime, the backcolor works, but the forecolor remains what was set in the forecolor property, not the collections property.

James

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Message Display By Value
« Reply #1 on: May 12, 2017, 07:13:34 PM »
Check the HighlightKeyCharacter and HighlightKeyCharacter2 to make sure neither of those characters are in your message because it can change the background also.

Phrog30

  • Guest
Re: Message Display By Value
« Reply #2 on: May 12, 2017, 07:18:27 PM »
No, they are "!" and ".", I'm not using those.  Like I said the backcolor works, just not the forecolor.  The forecolor remains constant from what is set in the forecolor property.

Phrog30

  • Guest
Re: Message Display By Value
« Reply #3 on: May 12, 2017, 07:25:18 PM »
If I delete those (leave blank) then the backcolor will not work at all.  I don't see the those two properties in your code.
Edit, I just noticed that you inherit from the dll, I opened your dll and really don't see why it won't work.
« Last Edit: May 12, 2017, 08:01:03 PM by Phrog30 »

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Message Display By Value
« Reply #4 on: May 12, 2017, 08:28:27 PM »
I uploaded a demo project that rotates through 7 messages with the click of a button. See if you get the same issue with this project:

https://sourceforge.net/projects/advancedhmi/files/advancedhmi/3.5/SampleProjects

The project is MsgByValueColorDemo

Phrog30

  • Guest
Re: Message Display By Value
« Reply #5 on: May 12, 2017, 10:32:44 PM »
Yes, same issue, forecolor does not change, backcolor does.  Have you tried it?  Just add 3-4 messages in the collection, make all of the backcolor and forecolor different.  I'm not using ini/text.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Message Display By Value
« Reply #6 on: May 12, 2017, 10:50:02 PM »
I updated the sample project. Added one using an INI file and the other using the Messages collection. For me I am seeing both back and fore colors change as I click through the messages

Phrog30

  • Guest
Re: Message Display By Value
« Reply #7 on: May 12, 2017, 11:38:34 PM »
It works, and it works in my project.  I compared yours to mine and changed my settings exactly as yours.  It still doesn't work.  So, there is something going on, I will try and figure this out tomorrow.

Phrog30

  • Guest
Re: Message Display By Value
« Reply #8 on: May 13, 2017, 10:41:34 AM »
Archie-
I'm not sure what to tell you on this, but this morning I dragged a new object on the screen.  I am using your application.  All I did was open the collections, add 6 members (0-5) and then edit each member's color and value settings.  I then added this object to your increment code, rebuilt, then ran app.  The backcolor works and the forecolor doesn't.  So, perhaps it's something in the order of generation.  But, there is something wrong.  So, try this as a step.  Drag a new object on the screen.  Don't do anything but add the messages in the collection list.  That should mimic what I did.

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5322
    • View Profile
    • AdvancedHMI
Re: Message Display By Value
« Reply #9 on: May 13, 2017, 11:16:04 AM »
I tried exactly as you said and I still can't get this to replicate. I tried it twice because the first time I forgot to put a number in for the message. The second time I set the 2 colors, put something into the Message, then set the Value property. Every time I am getting Foreground and Background color changes for every message

Phrog30

  • Guest
Re: Message Display By Value
« Reply #10 on: May 13, 2017, 12:55:32 PM »
I've done it about 30 times and each time it fails. I can copy yours and it works. So, how can this be?

Godra

  • Hero Member
  • *****
  • Posts: 1447
    • View Profile
Re: Message Display By Value
« Reply #11 on: May 14, 2017, 01:09:49 AM »
I tested the control on 2 computers, one with VS2013 and the other with VS2015, and both colors were changing for each of the 6 messages.

There is probably something corrupt on your computer.

Phrog30

  • Guest
Re: Message Display By Value
« Reply #12 on: May 14, 2017, 01:01:57 PM »
Thank you for testing on your side. I use images, so I will just create a new one and try again.

Phrog30

  • Guest
Re: Message Display By Value
« Reply #13 on: May 24, 2017, 04:23:07 PM »
Update, nothing I did changed the outcome.  However, I think I have at least figured out the problem area.  If I drop a listbox, button, etc. on this form, text starts off white.  All other forms will be black.  So, I'm sure whatever is causing this text color change is screwing up the message component.  I went through the code (for the form) and don't see anything that would cause the text color to change automatically.  Anyone have any ideas?

Phrog30

  • Guest
Re: Message Display By Value
« Reply #14 on: June 18, 2017, 08:46:38 PM »
I tried on 3 separate systems and we are all having issues.  So, either there is something in the DLL, or we just aren't testing the same.  Either way, I decided to make my own and I don't have the issues like the stock, here's the post:
http://advancedhmi.com/forum/index.php?topic=1810.msg10049#new