K Kevin May 25, 2007 #1 Does anyone know a simple way to have a program start with the main form maximized on Display2?
R rowe_newsgroups May 25, 2007 #2 Does anyone know a simple way to have a program start with the main form maximized on Display2? Click to expand... Assuming Display2 shows up as Screen.AllScreens(1) add this to a module: Public Sub Main() Application.EnableVisualStyles() Dim f As New MainForm() f.StartPosition = FormStartPosition.Manual ' You'll want to do some checking/error handling here to ' prevent an IndexOutOfRangeException from occuring f.Top = Screen.AllScreens(1).WorkingArea.Y f.Left = Screen.AllScreens(1).WorkingArea.X f.WindowState = FormWindowState.Maximized f.ShowDialog() End Sub Doing this requires you turn off the ApplicationFramework and select Sub Main as the starting point. Thanks, Seth Rowe
Does anyone know a simple way to have a program start with the main form maximized on Display2? Click to expand... Assuming Display2 shows up as Screen.AllScreens(1) add this to a module: Public Sub Main() Application.EnableVisualStyles() Dim f As New MainForm() f.StartPosition = FormStartPosition.Manual ' You'll want to do some checking/error handling here to ' prevent an IndexOutOfRangeException from occuring f.Top = Screen.AllScreens(1).WorkingArea.Y f.Left = Screen.AllScreens(1).WorkingArea.X f.WindowState = FormWindowState.Maximized f.ShowDialog() End Sub Doing this requires you turn off the ApplicationFramework and select Sub Main as the starting point. Thanks, Seth Rowe
K Kevin May 25, 2007 #3 Thanks for the reply, but actually I found Screen.AllScreens() just after posting the question (Guess I should've looked a little harder, eh?). Then I did a For...Each loop to get the working area of each screen. Works great. Thanks again.
Thanks for the reply, but actually I found Screen.AllScreens() just after posting the question (Guess I should've looked a little harder, eh?). Then I did a For...Each loop to get the working area of each screen. Works great. Thanks again.