473,399 Members | 3,106 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Maximize form on Display2

Does anyone know a simple way to have a program start with the main
form maximized on Display2?
May 25 '07 #1
2 1259
On May 25, 11:28 am, Kevin <kevinp@nospam_cfl.rr.comwrote:
Does anyone know a simple way to have a program start with the main
form maximized on Display2?
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

May 25 '07 #2
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.
On 25 May 2007 10:18:18 -0700, rowe_newsgroups <ro********@yahoo.com>
wrote:
>On May 25, 11:28 am, Kevin <kevinp@nospam_cfl.rr.comwrote:
>Does anyone know a simple way to have a program start with the main
form maximized on Display2?

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
May 25 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Ralph | last post by:
Hi My users are going to toggle back and forth between DataSheet and Form view. This eliminates the need for a pile of queries <g> Anyway, I would like my form to be viewed at the current size...
4
by: lauren quantrell | last post by:
I have an Access 2K popup form to which I have added buttons to run DoCmd.Maximize The problem is the form opens full height on the screen, with the bottom of the form hidden under the Windows...
0
by: Bill | last post by:
Hi I have a parent child forms. I want the close, maximize, and minimize buttons to be removed. One the child form I have set the maximize and minimize buttons to false. I have the child form...
3
by: guy | last post by:
VB2005 I have an MDI application, which displays modal forms correctly, and starts up with the MDI form maximized however for non modal forms behavious is unusual all forms have MaximizeBox,...
2
by: insomniux | last post by:
Hi, I have an Access 2000 database with one main form in which all subforms are embedded. In this form I have a timer which closes the form, detaches the linked (ODBC) tables and reopens the same...
5
by: Mrozu | last post by:
Hi When I maximize a form in VB.Net 2003 the bottom of the form gets hidden by the start bar (so my status bar is invisible). How can I get my app to maximize to the usable screen area above...
1
by: neeraj | last post by:
Hi people's I developed one MDI application with one MDI form and 2 child forms, form. Border style of first child forms set as Fixed3D and Window State set as normal (like dialog Box) and...
5
by: David Jackson | last post by:
Hello, I have a WinForms app (VS.NET 2005 + SP1) where the FormBorderStyle of the main form is set to FixedDialog. I've added a NotifyIcon, so have set the form's MinimizeBox property to...
3
by: =?Utf-8?B?Qm9iQWNoZ2lsbA==?= | last post by:
I give my user a button to change the properties of the size property of maximize screen size. How can I programmatically cause the maximize screen function to happen after changing the property...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.