Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Starting a form at a location
Message
De
08/10/2004 11:48:08
 
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00949879
Message ID:
00949920
Vues:
16
Gary,

You need to convert the client coordinates to screen coordinates. Something like this should position your form. Notice that you must set the forms StartPosition property.
private void button1_Click(object sender, EventArgs e)
{
   Rectangle rectPosition;          
   Form1 formTest = new Form1();

   formTest.StartPosition = FormStartPosition.Manual;

   formTest.Left = button1.RectangleToScreen(rectPosition).Left;
   formTest.Top = button1.RectangleToScreen(rectPosition).Top + button1.Height;

   formTest.Show();
}
Regards
Neil
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform