471,066 Members | 2,150 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,066 software developers and data experts.

Open a form upper right corner

Roy
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
Nov 23 '05 #1
2 5004
The following should work:
Me.Location = New
Point(System.Windows.Forms.Screen.PrimaryScreen.Wo rkingArea.Width - Me.Width,
0)

You might need to look in a bit more details if your running on 2 screens!
"Roy" wrote:
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

Nov 23 '05 #2
Roy
Thanks Simon, it worked just perfect.

"Simon" wrote:
The following should work:
Me.Location = New
Point(System.Windows.Forms.Screen.PrimaryScreen.Wo rkingArea.Width - Me.Width,
0)

You might need to look in a bit more details if your running on 2 screens!
"Roy" wrote:
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

Nov 23 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by fleemo17 | last post: by
3 posts views Thread by K.Kishore | last post: by
4 posts views Thread by Andre Majorel | last post: by
reply views Thread by leo001 | last post: by

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.