Button click event not opening the correct window

Is this a bug or something i am doing wrong.
I have multiple windows on one screen.

A button Rope work is meant to open the window Ropework and close others.
The event produces a diferernt window to the one in the code.
It goes to the 'Local knowledge' window.but if clicked a second time goes to the right window.
I have tried several optios. Other opening and closing widows all work
i attach aia file if that helps
MVSversion72.aia (1.7 MB)

If you look closely at your two button click events, you will see your error...

Perhaps a better way is to create a procedure to hide all your virtual screens, then run this in your button click events before selecting the arrangement to show:

image

Also, for future reference, you do not need to use the logic block, this works:

image

thank you for solution.
Most appreciated.

Can you tell me what i am doing wrong with my two button events just soi learn onmy mistakes.

I will change the coding as you have suggested.

What if your localKnowledge screen is visible?