Showing results 1 to 3 of 3

Thread: Setting dyn proprties for BackColor & LinkedFont to indexed values

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    17.03.2016
    Posts
    36

    Default Setting dyn proprties for BackColor & LinkedFont to indexed values

    Hi,

    I'm trying to set the DynProperties for an element but its not liking it as I'm trying to set them to 'linked' values.
    Code:
    elbutton.DynProperties("BackColor") = "8000000E"

    Code:
    elbutton.DynProperties("LinkedFont") = "Standard font2"
    Help file & forum searches aren't clear so could anyone provide an example code for how to do it?
    I don't want to hardcode the colour to an RGB value, as I'm trying to reference a colour on palette... an XML export shows me 8000000E (14th colour on my palette)

    Same for font- I want it to reference the font list so that if I change the font list I don't have to change all the instances of the text elements across multiple pages.

    How is this possible in VBA (even a VSTA example would help).

    Many thanks in advance.

    Dave

  2. #2
    Join Date
    17.03.2016
    Posts
    36

    Default Re: Setting dyn proprties for BackColor & LinkedFont to indexed values

    If I do DynPropertiesEnum("") for the particular object I'm trying to apply these to (a button) then I find that there isn't a 'LinkedFont' property, but there is a 'Font' property.
    The font as type ZT_SCHRIFT. Not sure why as both the property help and an XML export both show the property as LinkedFont.

    Also BackColor is type ZT_COLOR which I cant find an explanation of in the help file either.

    Still a bit confused here... does the application apply these proprieties in away which the API cannot access?
    Using the Zenon VBA really miss the way that in Excel you can 'record macro' and then apply the setting in the program and then review the code to see what object & methods are being used...

  3. #3
    Join Date
    17.03.2016
    Posts
    36

    Default Re: Setting dyn proprties for BackColor & LinkedFont to indexed values

    I have got values which work experimentally.

    For font it seems all you need is the dynProperties("Font") = 2 (or whatever the index is in the font table)

    For the colour from the palette I was able to show what the value is set by using a msgbox to show me the current value (in my case for index 14 it happened to be 2147483662).

    The first value in my palette (index 0) was 2147483648 so these are incremented to match the index number. I have no idea how emmuerate it directly within the code based on just the palette name or index directly.

Similar Threads

  1. Replies: 0
    Last Post: 26th January 2015, 12:36
  2. Setting transient values to 0
    By knubla in forum zenon Energy Edition
    Replies: 8
    Last Post: 26th May 2014, 10:04
  3. About Webserver setting
    By sidramsatyal in forum zenon Supervisor
    Replies: 3
    Last Post: 18th September 2013, 11:58
  4. Setting for Restoring PLC Value.
    By navaneet in forum zenon Supervisor
    Replies: 5
    Last Post: 9th September 2013, 00:09
  5. Variable setting
    By whitetaru in forum Drivers
    Replies: 2
    Last Post: 27th April 2011, 01:15

Tags for this Thread

Posting Rules

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