home *** CD-ROM | disk | FTP | other *** search
/ Programming in Microsoft Windows with C# / Programacion en Microsoft Windows con C#.iso / Original Code / An Exercise in Text Output / SysInfoFirstTry / SysInfoFirstTry.cs next >
Encoding:
Text File  |  2001-01-15  |  2.4 KB  |  66 lines

  1. //----------------------------------------------
  2. // SysInfoFirstTry.cs ⌐ 2001 by Charles Petzold
  3. //----------------------------------------------
  4. using System;
  5. using System.Drawing;
  6. using System.Windows.Forms;
  7.  
  8. class SysInfoFirstTry: Form
  9. {
  10.      public static void Main()
  11.      {
  12.           Application.Run(new SysInfoFirstTry());
  13.      }
  14.      public SysInfoFirstTry()
  15.      {
  16.           Text = "System Information: First Try";
  17.           BackColor = SystemColors.Window;
  18.           ForeColor = SystemColors.WindowText;
  19.      }
  20.      protected override void OnPaint(PaintEventArgs pea)
  21.      {
  22.           Graphics grfx  = pea.Graphics;
  23.           Brush    brush = new SolidBrush(ForeColor);
  24.           int      y     = 0;
  25.  
  26.           grfx.DrawString("ArrangeDirection: " +
  27.                           SystemInformation.ArrangeDirection, 
  28.                           Font, brush, 0, y);
  29.  
  30.           grfx.DrawString("ArrangeStartingPosition: " +
  31.                           SystemInformation.ArrangeStartingPosition, 
  32.                           Font, brush, 0, y += Font.Height);
  33.  
  34.           grfx.DrawString("BootMode: " +
  35.                           SystemInformation.BootMode, 
  36.                           Font, brush, 0, y += Font.Height);
  37.  
  38.           grfx.DrawString("Border3DSize: " +
  39.                           SystemInformation.Border3DSize, 
  40.                           Font, brush, 0, y += Font.Height);
  41.  
  42.           grfx.DrawString("BorderSize: " +
  43.                           SystemInformation.BorderSize, 
  44.                           Font, brush, 0, y += Font.Height);
  45.  
  46.           grfx.DrawString("CaptionButtonSize: " +
  47.                           SystemInformation.CaptionButtonSize, 
  48.                           Font, brush, 0, y += Font.Height);
  49.  
  50.           grfx.DrawString("CaptionHeight: " +
  51.                           SystemInformation.CaptionHeight, 
  52.                           Font, brush, 0, y += Font.Height);
  53.  
  54.           grfx.DrawString("ComputerName: " +
  55.                           SystemInformation.ComputerName, 
  56.                           Font, brush, 0, y += Font.Height);
  57.  
  58.           grfx.DrawString("CursorSize: " +
  59.                           SystemInformation.CursorSize, 
  60.                           Font, brush, 0, y += Font.Height);
  61.  
  62.           grfx.DrawString("DbcsEnabled: " +
  63.                           SystemInformation.DbcsEnabled, 
  64.                           Font, brush, 0, y += Font.Height);
  65.     }
  66. }