1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
int WidhtDef = 1366; //Mes paramètres
int HeightDef = 768;
string resolution = Screen.PrimaryScreen.ToString(); //Extrait la résolution
string[] LargeurHauteur = resolution.Split('=');
string[] largeur = LargeurHauteur[4].Split(',');
int width = int.Parse(largeur[0]); //largeur extraite
string[] hauteur = LargeurHauteur[5].Split('}');
int height = int.Parse(hauteur[0]); // hauteur extraite
decimal CoefWidth = (decimal)width / (decimal)WidhtDef;
decimal CoefHeight = (decimal)height / (decimal)HeightDef;
if (CoefWidth != 1 || CoefHeight != 1)
{
Navigateur Nav = new Navigateur();
Nav.panel1.Size = new System.Drawing.Size((int)(1308 * CoefWidth), (int)(48 * CoefHeight)); //ici est le problème!!
Nav.label1.Size = new System.Drawing.Size((int)(500 * CoefWidth), (int)(22 * CoefHeight)); //ici est le problème!!
} |