Open a form upper right corner

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
 
G

Guest

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!
 
G

Guest

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top