なんとなく

なんとなく書きます

windowの位置,サイズについて

winodwの位置とdisplay情報の取得について

◆windowの位置について

・アプリケーションのサイズを取得
アプリケーションの左上を原点にした領域を取得できる.
  Rectangle rect = this.ClientRectangle;
  Rectangle rect2 = DisplayRectangle;
の2つの方法か

・アプリケーションの位置を取得
画面左上の位置(displayの左上を原点)
  Point point = this.DesktopLocation;

画面左上の領域(displayの左上を原点)
  Rectangle rect = this.DesktopBounds;



◆display情報の取得について

System.Windows.Forms.Screen.AllScreens
ですべてのdisplayの情報を取得できる.

//すべてのスクリーンの情報を取得
Screen[] screen = Screen.AllScreens;

//スクリーン0の領域を取得
Rectangle a = screen[0].Bounds;

//スクリーン0のタスクバーなどを除いたアプリケーションが使える領域の取得
Rectangle b = screen[0].WorkingArea;