View Full Version : PictSwitch[0].Monitor problem

8th June 2011, 11:27
I have trouble when using
if (System.Windows.Forms.Cursor.Position.X >1920)
//position monitor 2
myFunctions.Item("Open_Trend_P2").set_DynProperties("PictSwitch[0].Monitor", 1);
//position monitor 1
//restore position relative to caller
myFunctions.Item("Open_Trend_P2").set_DynProperties("PictSwitch[0].Monitor", -2);

After this VSTA function. My standart function Open_Trend_P2 is opening always in Monitor 1.
I don't undestand why myFunctions.Item("Open_Trend_P2").set_DynProperties("PictSwitch[0].Monitor", -2) not work?

Thanks for answer

27th June 2011, 15:52

I tried myself to change the Monitor property - this works fine for me as long as I don't reset it back to -2. The problem was that not resetting it back to -2 changed my zenon function (which is intended this way). If I try to reset it in the same macro (just like you tried to do it), the screen switch does not work correctly anymore - as the RtFunctions.Start method now starts the screen switch function but the screen is opened on the first monitor and not on the one determined by the mouse pointer.

I don't know for sure if this is a bug or not, but I would recommend to do it this way: use a dummy function of the same type which you don't put on a button and then modify this one with VSTA. This should work and you don't need to reset the screen switch function.

I'll have some further investigation on this one. Hope I could help.