Showing results 1 to 5 of 5

Thread: Open screen before .Show()

  1. #1
    Join Date
    25.01.2021
    Posts
    25

    Frage Open screen before .Show()

    Hi, how to open screen in C# before .Show() ?

    in zenon help I can't find example, and link to vba example

    https://onlinehelp.copadata.com/Cont...347a7c4215f623

  2. #2
    Join Date
    02.02.2012
    Posts
    20

    Default Re: Open screen before .Show()

    Hi Oleksandr,

    usually, you don't need to call the method
    Code:
    IScreen.Show()
    . For opening a screen a zenon function of type Screen switch has to be executed. This function will bring the screen to the foreground, too.

    A zenon function cut be executed by calling
    Code:
    IFunction.Execute()
    . (https://onlinehelp.copadata.com/Content.html?product=addin&version=1000&lang=en&id =c_cdbe1d8750b66c929ccb59c539e2d58e#)

  3. #3
    Join Date
    25.01.2021
    Posts
    25

    Default Re: Open screen before .Show()

    Quote Originally Posted by martin_f View Post
    Hi Oleksandr,

    usually, you don't need to call the method
    Code:
    IScreen.Show()
    . For opening a screen a zenon function of type Screen switch has to be executed. This function will bring the screen to the foreground, too.

    A zenon function cut be executed by calling
    Code:
    IFunction.Execute()
    . (https://onlinehelp.copadata.com/Content.html?product=addin&version=1000&lang=en&id =c_cdbe1d8750b66c929ccb59c539e2d58e#)



    Hi,

    yes I resolved that as u describe. But that way leads to lot of function aggregation in project. May I avoid of using existing functions or scripts in project?

  4. #4
    Join Date
    10.12.2007
    Posts
    275

    Default AW: Open screen before .Show()

    You could use a dummy function of type screenswitch and change the called screen by the addin before you call the Execute() method.
    I didn't test it, but should work.
    Last edited by mst : 30th November 2021 at 09:31 Reason: Wrong methodname Start() instead of Execute()

  5. #5
    Join Date
    02.02.2012
    Posts
    20

    Default Re: Open screen before .Show()

    Hi Oleksandr,

    creating a lot of functions is the way you should go.

    You should always prefer using build-in solutions instead of creating your own ones. It is far easier to operate with a lot of functions than try to minimize them with your own solution. (You can search and filter functions. With the help of the PARAM paramter and index-based variable substitution, you can minimize the amount of functions.)

    You can manipulate the Dynproperties of a screenswitch function to open different screens, but if these screens are of different types, you have to do much more.


Similar Threads

  1. Open screen if variable value is?
    By milosh in forum Engineering Studio & Service Engine (former zenon Editor & Runtime)
    Replies: 1
    Last Post: 15th November 2021, 20:20
  2. screen resizes in editor after open and has to be closed and reopened
    By photomaddd in forum Engineering Studio & Service Engine (former zenon Editor & Runtime)
    Replies: 1
    Last Post: 19th May 2017, 16:24
  3. how to show cleared value in alarm, etc.
    By mnette81 in forum Engineering Studio & Service Engine (former zenon Editor & Runtime)
    Replies: 0
    Last Post: 5th December 2013, 10:09
  4. Open function on specific screen
    By softart2 in forum VSTA
    Replies: 2
    Last Post: 2nd June 2011, 04:23
  5. Zuweisung der Systemvariable last open screen
    By brenner in forum Engineering Studio & Service Engine (former zenon Editor & Runtime)
    Replies: 2
    Last Post: 27th October 2010, 08:46

Posting Rules

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