?
Solved

How do I set the Form startposition to upper right corner

Posted on 2004-11-12
4
Medium Priority
?
505 Views
Last Modified: 2012-08-13
Basically I want to set the form start position so that the form starts in the upper right corner of the screen.  I imagine that I need to retrieve resolution information to do this?  Anyhow I guess I'd probably just (x resoulution - form1.width) = startposition(x).  Also can you setposition onload? I'm away from the project atm or I'd check out this question myself.

Thanks for your time,
Matt
0
Comment
Question by:superfisch
  • 2
  • 2
4 Comments
 
LVL 14

Accepted Solution

by:
ptakja earned 300 total points
ID: 12568562
Yes. You can set the position at load:

Use the Screen object to get info about the screen:

Me.Location.X = Screen.PrimaryScreen.WorkingArea.Right - Me.Width
Me.Location.Y = 0

0
 
LVL 1

Author Comment

by:superfisch
ID: 12568674
Thanks for the response. Just about there..
I'm getting this error on the Me.Location.X and Y:
Expression is a value and therefore cannot be the target of an assignment.
do i need to use setposition(x, y)?
0
 
LVL 14

Expert Comment

by:ptakja
ID: 12568726
Try

Me.SetDesktopLocation(Screen.PrimaryScreen.WorkingArea.Right - Me.Width, 0)
0
 
LVL 1

Author Comment

by:superfisch
ID: 12568809
i got it:
Me.Location = New Drawing.Point(Screen.PrimaryScreen.WorkingArea.Right - Me.Width, 0)
Works Perfectly!
Thank you for providing the meat of the solution.

Thanks,
Matt
0

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Question has a verified solution.

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

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
The Relationships Diagram is a good way to get an overall view of what a database is keeping track of. It is also where relationships are defined. A relationship specifies how two tables connect to each other. As you build tables in Microsoft Ac…
Suggested Courses

578 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