Click here to Skip to main content
15,878,809 members
Please Sign up or sign in to vote.
1.30/5 (3 votes)
See more:
Dears,

I am working on a project where I need to display only a certain area from my GUI on a datashow (another screen). I want to have some sort of background control room that is not visiable to the spectators, and I want to do it by just showing certain portion from the GUI and keeping the rest just to me. I have no idea about how to start thinking. Is there a way to create video driver that would send the needed portion to the other display?
Posted
Updated 20-Nov-11 20:48pm
v3
Comments
BillWoodruff 20-Nov-11 11:15am    
1. are you describing a scenario in which one graphics card one one computer is driving both displays ?

2. please tag as WinForms, or WPF, or whatever

3. does the "certain portion" of the GUI you want viewed "solo" on the other display vary at times, or is it always the exact same area of the total GUI ?
zakariawaheeb 21-Nov-11 2:35am    
1. Yes, I am having one graphic card on my Laptop that derives the laptop screen and also a datashow (a projector) that is connected through an RGB cable to my laptop.
2.it is a WinForm
3. The "Certain Portion" of the GUI is the display I want the spectators to see, it would have a fixed size, but its content is variable.
I think the Second solution provided by
valery possoz is a good one, thanks for your help and I really appretiate it if you have any more ideas.
Sergey Alexandrovich Kryukov 20-Nov-11 18:32pm    
Do you mean "another screen" another display or something else?
Do you know what is the "video driver"? This is not part of UI and not anything which can run on .NET, not for existing systems. What is "keeping the rest just for me"? A part of UI is either displayed or not.
--SA
zakariawaheeb 21-Nov-11 2:36am    
I am having one graphic card on my Laptop that derives the laptop screen and also a datashow (a projector) that is connected through an RGB cable to my laptop, the "Another Screen" is the Datashow.
BillWoodruff 21-Nov-11 5:27am    
Glad you found the solution from Valery useful !

But, allow me to ask you one further question ... which I should have asked you in my first comment: is the content you want only the "audience" to see, content that can be put in one Form and displayed separately on the other monitor ?

The impression I have from your question is that you want that same content displayed on the "operator's" screen.

So is this the case where you need simultaneous presentation of identical looking Forms on both operator and audience screens ? Will Valery's solution enable that ?

If not, let us know here: I have some ideas about how you could go about this by synchronizing the controls across the operator screen with identical type controls on the content to be displayed to the audience (yes, I'm talking about duplication of controls).

good luck, Bill

Why going into such tricky game with two monitors? (Please see my question and tell us if I understood you correctly; is it about two different monitors.) You would be limited by the length of a cable, also, the risk of exposing a "secret" part of UI to the used of another monitor is too high, as in principle it always possible to show it using keyboard.

Why not coming to an obvious alternative? Have two different computers connected by a network. Run two different processes on two separate computers, one in a background control room, one in a second room. Choose from using socket programming (better using System.Net.Sockets.TcpListener/System.Net.Sockets.TcpClient), classical remoting or WCF (I would suggest self-hosting WCF by some process running in the background control room host, maybe the same process as the background control room part). Alternatively, you can have one server application (develop Windows Service) and two different processes running client part, one for the outside user, one for background control room. The Service itself can run on any of these two computers or on third one; this is not really important but might depend on required functionality.

And don't think that using an extra computer is too expensive. With network approach, you can save a lot of time and investment on just the development, so it can justify the use of a one more computer.

—SA
 
Share this answer
 
v2
Comments
zakariawaheeb 21-Nov-11 2:40am    
Thanks SAKryukov for your reply, but I think you didn't get me correctly. I meant by "Control Room" a GUI that controls what will appear on a desired portion of the GUI. I am trying to show certain portion of the GUI to the spectators and control what appear on it using controllers that are not visible to the spectators, I think "Solution 2" by valery possoz is a good approach to what I have in mind.
Hello,

Assuming you use only one computer that has several screens and you want to show your form on the second screen.

For WPF applications:
int screnToUse = 1;
Screen[] screens = Screen.AllScreens;
var formToShowToSpectators = new FormToShowToSpectators();
formToShowToSpectators.BorderThickness = new Thickness(0);
formToShowToSpectators.WindowStyle = WindowStyle.None;
formToShowToSpectators.Left = screens[screnToUse].Bounds.Left;
formToShowToSpectators.Top = screens[screnToUse].Bounds.Top;
formToShowToSpectators.Show();


For a winform Application:

C#
int screnToUse = 1;
Screen[] screens = Screen.AllScreens;
var formToShowToSpectators = new FormToShowToSpectators();
formToShowToSpectators.FormBorderStyle = FormBorderStyle.None;
formToShowToSpectators.Left = screens[screnToUse].Bounds.Left;
formToShowToSpectators.Top = screens[screnToUse].Bounds.Top;
formToShowToSpectators.StartPosition = FormStartPosition.Manual;
formToShowToSpectators.Show();


Then because you can't maximise a window before it is loaded change it's state in the Loaded Event of your form for WPF:
C#
private void Window_Loaded(object sender, RoutedEventArgs e)
{
    WindowState = System.Windows.WindowState.Maximized;
}


Or in the Load Event handler for WinForm:
C#
private void FormToShowToSpectators_Load(object sender, EventArgs e)
{
    WindowState = FormWindowState.Maximized;
}


You will need to add references to System.Windows.Form and System.Drawing to a WPF application

Valery
 
Share this answer
 
Comments
zakariawaheeb 21-Nov-11 2:45am    
Thanks valery possoz,

Your solution seems to be a valid one. As I mentioned in the comments above, I am having one graphic card on my Laptop that derives the laptop screen and also a datashow (a projector) that is connected through an RGB cable to my laptop. So, I think I will show my control form on my PC display and the output on the Datashow, I think I will use your code to do so with the help of the extended view option from windows.
Joezer BH 17-Dec-13 1:23am    
5ed!
BillWoodruff 21-Nov-11 5:23am    
+5 an excellent answer Valery. Really good to see you include information for both WinForms and WPF. If this solution meets Zakariawaheeb's needs, that's great !

The one question that comes to my mind though is: in the original question I think there is an implication that the content that needs to be shown is not on a separate form.

However, that's something I should have asked the OP about immediately. And I will add a further question to the original post about this, out of curiousity.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900