1. 程式人生 > >C# 控制元件調整

C# 控制元件調整

            //最大化
            this.WindowState = FormWindowState.Maximized;
            //去掉標題欄
            this.FormBorderStyle = FormBorderStyle.None;

            //設定picbox
            this.pictureBox1.Width = this.Width;
            this.pictureBox1.Height = this.Height;
            this.pictureBox1.Left = 0
; this.pictureBox1.Top = 0; this.pictureBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right)));
this.pictureBox1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;//設定背景影象佈局 this.pictureBox1.Dock = System.Windows.Forms.DockStyle.Fill; //隨著父級一起改變 this.pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;//自適應

 

  //最大化
            this.WindowState = FormWindowState.Maximized;
            
////去掉標題欄 //this.FormBorderStyle = FormBorderStyle.None; //設定picbox this.axWindowsMediaPlayer1.Width = this.Width; this.axWindowsMediaPlayer1.Height = this.Height; this.axWindowsMediaPlayer1.Left = 0; this.axWindowsMediaPlayer1.Top = 0; this.axWindowsMediaPlayer1.Dock = System.Windows.Forms.DockStyle.Fill; //隨著父級一起改變