Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cloning a form on an extended desktop

Here is my situation (sorry for being long-winded, but I'm finding it difficult to describe this concisely):

We have a C# application (that we develop) that runs on a system with two monitors. However, each monitor faces a different user. That is, user 1, who has control, only sees monitor A and user 2, who has a 'read-only' position only sees monitor B. Up until now, we have been using a cloned display, such that A and B display the same information. However, it is desirable to be able to display different things to users 1 and 2 at specific instances in the workflow.

This calls for a situation where the desktop is sometimes Cloned and other times is Extended. Unfortunately, this solution seems undesirable to me because of what happens visually when you switch between desktop modes (screen goes black, temporary repositioning of windows) - it's basically not a clean transition. This is why I'm exploring alternatives.

Obviously, a Cloned-only solution won't work, so that leaves Extended mode.

Extended mode easily allows me to display two different forms on Monitors A and B, but what can I do for the times I want both monitors showing the same thing? Is there a way for me to show a "copy" or "clone" of a C# System.Windows.Forms.Form while the original is open, that reflects the same information?

Is there another solution to this problem that I'm overlooking? Or is the "switch between display modes using DisplaySwitch.exe" approach as good as it gets?

(assume we have complete control over the platform - hardware and software)

like image 589
Kohanz Avatar asked Sep 06 '11 20:09

Kohanz


People also ask

Can I mirror one monitor and extend another?

Yes you can do it. You just select the monitor in the display settings in windows (right click the desktop > display settings) click the new monitor (3 in your case) and select "Duplicate desktop on 1 and 3" in the "Multiple displays" box, and it should ask you to confirm, and that's it!

Why do both monitors show the same thing?

Right click the Desktop and select the Screen Resolution item. In the dialog box, use the Multiple displays drop down menu to select 'Extend these displays'. If this does not work, click the Detect Button at the top of the screen. Hope this helps.

What does extend desktop to display mean?

Extended Desktop Definition The Extended Desktop mode means that all your monitors behave as one big screen. Each monitor displays a different section of the general display image. In other words, each monitor displays different things.


2 Answers

Consider using a remote access program like TightVNC. It can operate in loopback mode, displaying the main monitor image in the client program. Which you then have to move to the second monitor to get the clone. Together with the custom form that you minimize and restore.

like image 53
Hans Passant Avatar answered Oct 03 '22 12:10

Hans Passant


To elaborate on my comment now that I have more time.

Rather than trying to clone Form A into Form B, set up some kind of communication layer between the two, such that Form A doesn't care what it's communicating with or whether the data displayed is the same or completely different.

The easiest way to do this is to hook a mediator into events on Form A and, when those events are triggered, send the necessary data to Form B to render it.

In the case where the data is the same, this could be as simple as taking a snapshot every time Form A updates and rendering it on Form B (much like harvardflu's answer, but putting that logic in a mediator), or you could take it as far as running the application process in another thread and updating Form A and Form B simultaneously through different mediators (though, as you suggest, this will probably be a major reengineering).

It is likely that the optimal solution is somewhere in between.

like image 27
pdr Avatar answered Oct 03 '22 12:10

pdr