tags:

views:

1048

answers:

2

Hi

How can I position a form at the bottom right corner of the screen when the form load?

I use visual basic 2010 express

(sorry I am a beginner)

thanks

EDIT: i did sth and it seems to work great

here;

Dim x As Integer
        Dim y As Integer
        x = Screen.PrimaryScreen.WorkingArea.Width - 400
        y = Screen.PrimaryScreen.WorkingArea.Height - 270
        Me.Location = New Point(x, y)
+2  A: 

You need to change the Form.StartPosition to Manual and change the Location property of the form

eg how to set form startup location/position manually?

or

VB.net - Form Start Position Upper Left

using Form.StartPosition Property and Form.Location Property

astander
thank you so much, got it
Ahmet vardar
That's only half the answer - equally as important and *much* harder to track down though its actually something that every desktop programmer should know (and the really key question) is how to get the size and location of the work area of the desktop. I last did this in Delphi, longer ago than I care to remember and I haven't yet found the .NET answer... (or at least I can't recall so doing).
Murph
at least i have a beginning point
Ahmet vardar
Screen.GetWorkingArea returns the size and location of the useful part of the display. Or in excruciating detail, the desktop area of the display, excluding taskbars, docked windows, and docked tool bars. You pass in a control, because there might be multiple monitors, in which case it uses the control to decide which monitor you meant. http://msdn.microsoft.com/en-us/library/45zswy9x.aspx
MarkJ
Here's some sample code in C#, it translates to VB.Net pretty directly. (`This` is `Me`) http://stackoverflow.com/questions/1385674/place-winform-on-bottom-right/1385691#1385691
MarkJ
yeah i edited my question with the code i wrote and it seems to work
Ahmet vardar
A: 

You can loop through the child forms and do some calculations based on the top and left properties (might want to combine those calcs with Width and Height properties depending on what your requirement is for "bottom left")

HTH, Mark

Mark Cooper