Autor Beitrag
Phelios
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 38

Win XP, Win 7
Visual Studio 2012 Express C#
BeitragVerfasst: Mi 13.05.09 15:19 
Hi Leuts ...

Wie erfrage ich die aktuelle Bildschirmauflösung?
Ich hab herausgefunden, dass wohl die Klasse "Screen"
dafür zuständig ist, aber selbst bei MSDN bin ich nicht
fündig geworden. :oops:

So was wie ...

if(ScreenX < 1024 && ScreenY < 768)
{
// Auflösung zu klein
}

Ich weiß, dass es falsch ist, aber wie formuliere
ich so was?

Danke für Eure Tips

Greeting
( Karl )
danielf
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 1012
Erhaltene Danke: 24

Windows XP
C#, Visual Studio
BeitragVerfasst: Mi 13.05.09 15:30 
Hallo,

du kannst die Auflösung der angeschlossenen Bildschirme mit der Klasse Screen abfragen.

Zum Beispiel für den primären Monitor:

ausblenden C#-Quelltext
1:
2:
 int screenHeight = Screen.PrimaryScreen.Bounds.Height;
 int screenWidth = Screen.PrimaryScreen.Bounds.Width;


Gruß Daniel
Phelios Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 38

Win XP, Win 7
Visual Studio 2012 Express C#
BeitragVerfasst: Mi 13.05.09 17:12 
Hallöchen ...

user profile icondanielf hat folgendes geschrieben Zum zitierten Posting springen:

ausblenden C#-Quelltext
1:
2:
 int screenHeight = Screen.PrimaryScreen.Bounds.Height;
 int screenWidth = Screen.PrimaryScreen.Bounds.Width;



Das ist ja echt super, und funktioniert.
Danke für Deine schnelle Hilfe.

Greeting
( Karl )