Solved

Loading a form on a particular monitor in a multiple display system

Posted on 2006-11-10
1
173 Views
Last Modified: 2010-04-23
I have a two display system. VS2005 and my app are being developed on display #2. When I start the app by selecting "Start Debugging" it launches on display #2. However, one of the forms I use for a dialog box opens on monitor #1. Is there a way to specify how an application function on a multiple display system?
0
Comment
Question by:tmostad
1 Comment
 
LVL 9

Accepted Solution

by:
jrscherer earned 500 total points
ID: 17919650
Hi tmostad,
use the property  Form.StartPosition and set it to CenterParent.

Here is a snippet to play with. Put it into any form and click the screen. It will give you the start position of the screen your form is on, or more exactly, the start position of the screen you made the click on, if your form overlaps screens.

    Private Sub Form1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Click
        Dim r As Rectangle = Screen.GetBounds(Control.MousePosition)
        MessageBox.Show("This screen is at X= " & r.X & " Y = " & r.Y & "  Width = " & r.Width & "  Height = " & r.Height)

        Dim screens() As Screen = Screen.AllScreens
        MessageBox.Show("This computer has " & (screens.GetUpperBound(0) + 1).ToString & " Screens")
    End Sub

Jack.net
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VB.Net error: An exception occurred during a WebClient request 6 42
FInd Image Control Gridview 3 37
Stop Git from being my repository 1 26
vb.net datagrid point 4 23
This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question