2009-09-06 19 views

risposta

42

provare qualcosa sulle linee di

Rectangle workingArea = Screen.GetWorkingArea(this); 
this.Location = new Point(workingArea.Right - Size.Width, 
          workingArea.Bottom - Size.Height); 

spero che funziona bene per voi.

+0

Eccellente. Grazie per questo, vorrei poterlo accettare come risposta: p –

0

In si forma costruttore messo il seguente codice:

StartPosition = FormStartPosition.Manual; 

Questo imposterà la posizione iniziale della forma a tutto ciò che si imposta come valore per la posizione del modulo (è possibile impostare questo nel form designer) .

+1

problema di questo è che tutti utilizzano diversi schermi di dimensioni, potrebbe apparire bene sul vostro, ma non vuol dire che sarà su un clienti ... –

+0

1 - Sì, credo avresti bisogno che uno pure, per fare in modo che il modulo utilizzi la posizione specificata. –

10
Form2 a = new Form2(); 
a.StartPosition = FormStartPosition.Manual; 
a.Location = new Point(Screen.PrimaryScreen.WorkingArea.Width - a.Width, 
         Screen.PrimaryScreen.WorkingArea.Height - a.Height); 
0

Questo ha funzionato per me; Ho appena messo le 3 linee di codice elencato di seguito dopo il mio InitializeComponent();

public FormProgress() 
{ 
    InitializeComponent(); 
    Rectangle r = Screen.PrimaryScreen.WorkingArea; 
    this.StartPosition = FormStartPosition.Manual; 
    this.Location = new Point(Screen.PrimaryScreen.WorkingArea.Width - this.Width, Screen.PrimaryScreen.WorkingArea.Height - this.Height); 
} 
0

E 'facile da provare;

//Get screen resolution 
Rectangle res = Screen.PrimaryScreen.Bounds; 

// Calculate location (etc. 1366 Width - form size...) 
this.Location = new Point(res.Width - Size.Width, res.Height - Size.Height); 
Problemi correlati