Is it possible to create a window that is larger than the screen?

I have an application that I have created, it grows based on its content. content width may vary from time to time. When the window becomes larger than the screen, the window will be cut.

Can I make the window larger than the screen?

+3


source to share


2 answers


I am sure that this is possible:

<Window x:Class="WpfApplication1.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="MainWindow" Height="2000" Width="5000" Left="-10" Top="-10">
    <Grid>

    </Grid>
</Window>

      



Okay, I guess you want to do this dynamically, right? I could think of some code to check the size of the content and set the size of the window.

(although I don't like what you want to achieve);)

0


source


In WPF, I can dynamically create a window larger than the screen using the following:

        var window = new Window();
        window.Width = 8620;
        window.Height = 400;

        window.Top = 400;
        window.Left = 0;

        window.WindowStyle = WindowStyle.None;
        window.AllowsTransparency = true;
        window.Show();

      



I know this works because if I connect a second monitor and expand it the window becomes visible (set the border - set WindowStyle, change the background color, or show the content to see the window).

0


source







All Articles