Showing results 1 to 3 of 3

Thread: VBA screen switch on multi-monitor system

  1. #1
    Join Date
    05.08.2013
    Posts
    15

    Frage VBA screen switch on multi-monitor system

    Hi to all
    I use zenon 7.11 with 2 monitors. I have some popup screen which I start by the screen switch function from VBA code from combined element. I use VBA code for some substitutions of the replace links of the my RTfunction.
    My combined element can be displayed on left or on right monitor accordingly. But my popup screen is always displayed on left monitor.

    Would you tell me how to do that popup screen is displayed on right monitor if it was started from right monitor?

    P.S. I've tested If I start my screen switch function not from VBA code but just from button then my popup screen is displayed correctly. From left monitor on left monitor. And from right monitor on right monitor accordingly.

    Part of VBA code that I use.
    Public Sub StartFunction(strFuncName As String)
    Dim zFCT As RtFunction

    Set zFCT = thisProject.RtFunctions.item(strFuncName)
    If Not zFCT Is Nothing Then
    zFCT.Start
    End If
    End Sub
    Last edited by andrey_k : 17th June 2014 at 13:23
    BR, Andrey K.

  2. #2
    Join Date
    30.05.2007
    Location
    Salzburg
    Posts
    879

    Default Re: VBA screen switch on multi-monitor system

    Maybe this thread can help you:
    http://www.copadata.com/forums/showthread.php?t=2516

    regards,
    herbert


  3. #3
    Join Date
    05.08.2013
    Posts
    15

    Default Re: VBA screen switch on multi-monitor system

    Problem has been solved.

    Public Sub StartFunction(strFuncName As String)

    ' ****** Monitor counter starts at 0, on this project the projects are named as Left = 0, Right = 1

    Dim zPIC As DynPicture
    Dim zFCT As RtFunction

    ' ****** The screen switch function to be executed and manipulated to open in the according monitor
    Set zFCT = thisProject.RtFunctions.Item(strFuncName)

    ' ****** ATTENTION: The picture where the combined element is opened must be defined here!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    Set zPIC = thisProject.DynPictures.Item("picture_free")

    If Not zFCT Is Nothing Then

    ' ****** Assumes first the "combined element screen" is on the right monitor so the following screen must be also open on right monitor...
    zFCT.DynProperties("PictSwitch[0].Monitor") = 1

    ' ****** *.Left / *.Right corresponds on next code lines are DynPicture properties and not monitor names!!!

    If zPIC.Left = 0 Then
    ' ****** ... but if the "combined element screen" is on the left monitor, the following screen must open on the left monitor
    zFCT.DynProperties("PictSwitch[0].Monitor") = 0

    End If

    End If

    ' ****** ATTENTION: In case when the "combined element screen" is open in both monitors at the same time,
    ' ***************** the new screen will be opened on the last monitor where the "combined element screen"

    zFCT.Start

    End Sub
    BR, Andrey K.

Similar Threads

  1. multi monitor configuration lost if monitors switched off
    By wopmsc in forum zenon Supervisor
    Replies: 12
    Last Post: 3rd March 2014, 12:48
  2. Screen switch with replace links in multi-server projects
    By stolyarov_as in forum zenon Supervisor
    Replies: 1
    Last Post: 11th July 2013, 09:47
  3. Multi-Monitor with different resolutions
    By martijnvanspijk in forum zenon Supervisor
    Replies: 6
    Last Post: 22nd May 2013, 12:26
  4. Screen Switch in VBA
    By paruvathakumar in forum VBA
    Replies: 12
    Last Post: 28th August 2012, 01:26
  5. Multi monitor in grid 2x2
    By brada in forum zenon Supervisor
    Replies: 14
    Last Post: 25th October 2011, 09: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
  •