Open a form upper right corner

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all,

I need to open a form in the uppper righ of the screen. My approach is:
create a function that returns Width of user's machine resolution:

dim x as integer = GetWidthOfUsersMonitorResolution
dim widthOfform as integer = 400 'Widh of my form
and then
Me.Location = New System.Drawing.Point(x-y, 0)

Does the approach make sense? If so, How should I get the width of user's
resolution.
Or there is a better way that I'm unaware.
Thanks in advance
Roy
 
The following should work:
Me.Location = New
Point(System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Width - Me.Width,
0)

You might need to look in a bit more details if your running on 2 screens!
 
Thanks Simon, it worked just perfect.

Simon said:
The following should work:
Me.Location = New
Point(System.Windows.Forms.Screen.PrimaryScreen.WorkingArea.Width - Me.Width,
0)

You might need to look in a bit more details if your running on 2 screens!
 
Back
Top