Search code examples
c#projector

Bounded Display using C#


Way to create an application which will display only bounded content via projector. Simple Scenario - I have one form in C#, having picture box property. I want only picture to be displayed via projector not the whole desktop view/form.


Solution

  • This should display one form on the last screen on your system, filling it up completely without anything but the PictureBox showing up:

    public Form1()
    {
       InitializeComponent();
    
       this.WindowState = FormWindowState.Maximized;
       this.Text = "";
       this.ControlBox = false;
       this.MinimizeBox = false;
       pictureBox1.Dock = DockStyle.Fill;
    
       // if you want the form to display on the last screen try this:
       this.Location = Screen.AllScreens
                      [Screen.AllScreens.Length - 1].WorkingArea.Location;
    
    }
    

    You'll have to decide on the pictureBox1.SizeMode..

    Of course you'll have to know, which of your screens is set to be primary.