コード例 #1
0
 private void Display_Resize(object sender, EventArgs e)
 {
     if (this.WindowState == FormWindowState.Minimized)
     {
         this.Visible = false;
     }
     Display1.SetBounds(this.ClientRectangle.X, this.ClientRectangle.Y, this.ClientRectangle.Width, Display1.Font.Height * 7);
     Display2.SetBounds(this.ClientRectangle.X, this.ClientRectangle.Y + Display1.Height, this.ClientRectangle.Width, this.ClientRectangle.Height - Display1.Height);
 }
コード例 #2
0
        public Display()
        {
            InitializeComponent();
            this.Text = "Dictionary Server";
            Display1.SetBounds(this.ClientRectangle.X, this.ClientRectangle.Y, this.ClientRectangle.Width, ClientRectangle.Height * 1 / 3);
            Display2.SetBounds(this.ClientRectangle.X, this.ClientRectangle.Y + Display1.Height, this.ClientRectangle.Width, this.ClientRectangle.Height - Display1.Height);

            UpdateTimer.Interval = 1000;
            UpdateTimer.Tick    += new EventHandler(UpdateDisplay);
            UpdateTimer.Tag      = 0;
            UpdateTimer.Start();
            ThreadPool.QueueUserWorkItem(delegate
            {
                Program.Init();
            }, null);
            ThreadPool.QueueUserWorkItem(delegate
            {
                Program.WaitForConnections();
            }, null);
            Display1.SetBounds(this.ClientRectangle.X, this.ClientRectangle.Y, this.ClientRectangle.Width, Display1.Font.Height * 7);
            Display2.SetBounds(this.ClientRectangle.X, this.ClientRectangle.Y + Display1.Height, this.ClientRectangle.Width, this.ClientRectangle.Height - Display1.Height);
        }