473,404 Members | 2,195 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,404 software developers and data experts.

Maximizing the app on the second monitor.

Hello,

I am trying to make sure that my app always loads on the monitor (and
maximizes there).
Currently, I just get the .Bounds off Screen.AllScreens[1].

Then I change the .Location of my winform to the .Bounds.Left and
..Bounds.Top and then I maximize the form.

Is there a better way of doing this, as this approach seems like a bit
of a hack.

Thanks
Nov 17 '05 #1
2 6630
That's the right way.

I don't think there is another way.

Gustavo.

"Frank Rizzo" <no**@none.com> wrote in message
news:uY**************@tk2msftngp13.phx.gbl...
Hello,

I am trying to make sure that my app always loads on the monitor (and
maximizes there).
Currently, I just get the .Bounds off Screen.AllScreens[1].

Then I change the .Location of my winform to the .Bounds.Left and
.Bounds.Top and then I maximize the form.

Is there a better way of doing this, as this approach seems like a bit of
a hack.

Thanks

Nov 17 '05 #2
Frank,
I normally set the bounds of my form to the bounds of the screen.

Something like (VB.NET):

Protected Overrides Sub OnLoad(ByVal e As System.EventArgs)
MyBase.OnLoad(e)
Dim s As Screen
For Each s In Screen.AllScreens
If Not s.Primary Then Exit For
Next
Me.Bounds = s.Bounds
Me.WindowState = FormWindowState.Maximized
End Sub

NOTE: I look for the non primary screen, rather then assume AllScreens[1] is
the second screen...

Hope this helps
Jay

"Frank Rizzo" <no**@none.com> wrote in message
news:uY**************@tk2msftngp13.phx.gbl...
| Hello,
|
| I am trying to make sure that my app always loads on the monitor (and
| maximizes there).
| Currently, I just get the .Bounds off Screen.AllScreens[1].
|
| Then I change the .Location of my winform to the .Bounds.Left and
| .Bounds.Top and then I maximize the form.
|
| Is there a better way of doing this, as this approach seems like a bit
| of a hack.
|
| Thanks
Nov 17 '05 #3

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

Similar topics

1
by: HockeyTownUSA | last post by:
I am working a project where I am using two monitors and using HTML/Javascript to display the information I want. I have my main stuff on the main monitor, but when each page loads, I want an...
1
by: Jean-David Beyer | last post by:
I am presently running DB2 V8.1.6 on Red Hat Enterprise Linux 3 ES. Every second, the following messages appear in my /var/log/messages file: Jul 10 09:04:45 kernel: application bug:...
0
by: Dave Taylor | last post by:
I am developing a program that is specifically targeted for a dual-monitor configuration. It is easy enough to get windows to appear on one display or the other as long as the WindowState is...
7
by: Elmo Watson | last post by:
(using VS.net 2005 - never used DotNet WinForms til now - previously only used VB6) I have set my mdi child form to a window state of maximized. However, the first file I open is not maximized...
1
by: Duncan S | last post by:
I am writing a service that uses the second monitor as a notice board the service runs okay if started when a user logs on. however the screen is blanked when the user logs out. is there any way a...
1
by: mentu | last post by:
Hi, i have an acer aspire with nVIDIA GeForce Go7300 that support a dual-monitor. I use the monitor of the laptop and a projector. I try to develop a software that open a form on second monitor....
2
by: BrianT | last post by:
I'm trying to write an application in VB.NET that displays a single form on a second monitor only. So far, I've discovered that I can only have forms that are created during runtime (programatically)...
1
by: Peted | last post by:
Hi im using XP sp2, vs 2008 pro and working in c# winforms apps. I have two monitors when coding and was wondering if there was a way, when debuggin a winforms app i could always make the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
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.