Results 1 to 7 of 7

Thread: How to really fill up all screens?

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,091

    How to really fill up all screens?

    I'm building an application that essentially attempts to fill up all of the user's screens with a maximized form. On most machines this works. I'm simply using My.Computer.Screen.AllScreens enumeration to get a reference to all the user's screens (assuming a multi-screen setup). I'm then using the following to set the forms:

    Code:
                For i As Integer = 0 To My.Computer.Screen.AllScreens.Count - 1
                    frm = New BlankForm
                    BlankScreens.Add(frm)
                    frm.Location = New Point(My.Computer.Screen.AllScreens(i).Bounds.Left, 0)
                    frm.Show()
                Next
    For whatever reason, this is not always working, and only showing on one screen. Is there a better way at accomplishing this?

    Visual Studio 2010

  2. #2
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: How to really fill up all screens?

    That code doesn't look like a maximized form filling up all screens, it looks like 1 form for each screen...

    How does this work for you? It works for me on my 4 LCD setup.

    Code:
        Public Shared Sub main()
    
            Dim AllScreenSize As Size
            Dim LeftMostPosition As Integer = 0
    
            For Each S As Screen In Screen.AllScreens
                If S.Bounds.Left < LeftMostPosition Then LeftMostPosition = S.Bounds.Left
                AllScreenSize += S.Bounds.Size
            Next
    
    
            Dim frm As New Form1
            frm.StartPosition = FormStartPosition.Manual
            frm.FormBorderStyle = Windows.Forms.FormBorderStyle.None
            frm.WindowState = FormWindowState.Normal
            frm.Size = AllScreenSize
            frm.Location = New Point(LeftMostPosition, 0)
            frm.ShowDialog()
    
        End Sub

  3. #3
    PowerPoster JuggaloBrotha's Avatar
    Join Date
    Sep 2005
    Location
    Lansing, MI; USA
    Posts
    4,286

    Re: How to really fill up all screens?

    Quote Originally Posted by kleinma View Post
    That code doesn't look like a maximized form filling up all screens, it looks like 1 form for each screen...

    How does this work for you? It works for me on my 4 LCD setup.

    Code:
        Public Shared Sub main()
    
            Dim AllScreenSize As Size
            Dim LeftMostPosition As Integer = 0
    
            For Each S As Screen In Screen.AllScreens
                If S.Bounds.Left < LeftMostPosition Then LeftMostPosition = S.Bounds.Left
                AllScreenSize += S.Bounds.Size
            Next
    
    
            Dim frm As New Form1
            frm.StartPosition = FormStartPosition.Manual
            frm.FormBorderStyle = Windows.Forms.FormBorderStyle.None
            frm.WindowState = FormWindowState.Normal
            frm.Size = AllScreenSize
            frm.Location = New Point(LeftMostPosition, 0)
            frm.ShowDialog()
    
        End Sub
    Works on my 2-Screen computer too.
    Currently using VS 2015 Enterprise on Win10 Enterprise x64.

    CodeBank: All ThreadsColors ComboBoxFading & Gradient FormMoveItemListBox/MoveItemListViewMultilineListBoxMenuButtonToolStripCheckBoxStart with Windows

  4. #4

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,091

    Re: How to really fill up all screens?

    Cool, I'll give it a shot and let you know.

    Visual Studio 2010

  5. #5

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,091

    Re: How to really fill up all screens?

    Does this assume that all screens are the same size? In our environment, they are not, hence the reason why I was instantiating multiple forms.

    Visual Studio 2010

  6. #6

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,091

    Re: How to really fill up all screens?

    Doesn't work for me. Does this code assume the screen are the same size and resolution? In our environment, they are not.

    Visual Studio 2010

  7. #7

    Thread Starter
    Frenzied Member
    Join Date
    Aug 2000
    Posts
    1,091

    Re: How to really fill up all screens?

    Actually, maybe it does work. I broke this code out into its own application and it does seem to work. There might have been something else in the code preventing this from working correctly. Thanks!

    Visual Studio 2010

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width