码迷,mamicode.com
首页 > Windows程序 > 详细

C# 控件调整

时间:2018-11-20 11:32:25      阅读:183      评论:0      收藏:0      [点我收藏+]

标签: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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!