C# 控件调整

2021-06-30 07:08

阅读:590

标签:order   one   nbsp   布局   div   windows   window   top   fill   

            //最大化
            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; //随着父级一起改变

 

C# 控件调整

标签:order   one   nbsp   布局   div   windows   window   top   fill   

原文地址:https://www.cnblogs.com/enych/p/9987339.html


评论


亲,登录后才可以留言!