Showing results 1 to 2 of 2

Thread: Change color palette via VBA

  1. #1
    Join Date
    01.02.2016
    Posts
    8

    Default Change color palette via VBA

    Hi all.
    How to change (switch) color palette via VBA?
    Idea is to save color palette  internal variable (integer) which is remanent.
    On scada startup I should to check value of that variable and set color palette which depends of that variable state.

    BR,
    Miloš

  2. #2
    Join Date
    10.12.2007
    Posts
    182

    Cool AW: Change color palette via VBA

    No need for VBA. I've done this already. Just use internal remanent Variable, create Reactionmatrix that has different functions to switch colorpalette on diffrent discrete states and link it to the variable. To switch the color palette in the runtime don't use a colorpallet switch function with RT dialog, but for example use a combobox to set the internal variable. So you can make entries in the combobox according to the colorpallet.
    (Example: you have 2 pallets: A=red, B=green, then you need 2 functions to directly set this pallets without dialogue, create internal remanent variable and link it to reactionmatrix that has 2 entries besides default: A=red with function to switch to A attached and B=green with function that switches to green attached. Now if you change the value of the variable in runtime, the colorpallet will switch. Then you can choose how to set the variable, via buttons, combobox...)

    If you really want to do it with VBA, then call the function to switch from VBA. But the above way works fine

    btw.: I've done the same for fontlists with different fonttypes. I only miss an internal function (without VBA) to link this variable values to RT Profiles. If this would be possible, then every user could get his color and Font settings right at login. ;-)
    Last edited by mst : 9th November 2018 at 15:00 Reason: additional information

Similar Threads

  1. Change Text Color with Straton
    By jesus_michel in forum straton / zenon Logic
    Replies: 4
    Last Post: 9th April 2018, 17:50
  2. Replies: 5
    Last Post: 18th July 2014, 13:06
  3. How to Change color of dynamic text element
    By fred.tunell@dateli.se in forum VBA
    Replies: 1
    Last Post: 19th June 2014, 08:28
  4. Change Numeric display color on inactive
    By bsneddon in forum zenon Supervisor
    Replies: 1
    Last Post: 6th May 2014, 07:02
  5. press button - change color
    By rgv0021 in forum VBA
    Replies: 2
    Last Post: 28th October 2013, 08:05

Posting Rules

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •