How do I set the Form startposition to upper right corner

Posted on 2004-11-12
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,
Question by:superfisch
    LVL 14

    Accepted Solution

    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

    LVL 1

    Author Comment

    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)?
    LVL 14

    Expert Comment


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

    Author Comment

    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.


    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Join & Write a Comment

    This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
    I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
    Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
    Here's a very brief overview of the methods PRTG Network Monitor ( offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

    745 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

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now