Link to home
Start Free TrialLog in
Avatar of RIAS
RIASFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Setting a location of screen on a dual screen monitor

Hi,
Trying to set a working area for a dual screen .
The form opens on Screen2 rather than Screen1.
Any suggestion on how to open on the same screen as the MainForm

FrmMain : is the Main form
Code:
  With Frm2
                       
                        .StartPosition = FormStartPosition.Manual
                        workingArea = Screen.GetWorkingArea([b]FrmMain[/b])
                        .Location = New Point(workingArea.Right - Size.Width,
                          workingArea.Bottom - Size.Height)
                        .ShowDialog()                      
                    End With

Open in new window


Thanks
ASKER CERTIFIED SOLUTION
Avatar of Rikin Shah
Rikin Shah
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Also this should work-

Form2.Location = FrmMain.Location

Open in new window

SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of RIAS

ASKER

Thanks Andy! Will try
ps.  To find out what happens with your current code you ought to use a breakpoint and single step to CHECK just what you get as values of the main forms location and what you are putting as values for the location of Frm2
Avatar of RIAS

ASKER

Thanks!