日期:2014-05-17  浏览次数:21019 次

c# 创建的pictruebox PictureBoxSizeMode.StretchImage 无效,求大神帮忙,在线等~~
p1 = new PictureBox(); 
          
            p1.Refresh();
        
          //  p1.MouseClick += new EventHandler(p1_Rigth_click);
             
            this.Controls.Add(p1); 
            p1.SizeMode = PictureBoxSizeMode.StretchImage;()
            p1.BackgroundImage = Properties.Resources._11222;
            p1.Refresh();
            p1.Width = 100;
            p1.Height = 100;
            isDragging = true;  //可以拖动
            currentX = e.X;
            currentY = e.Y;
            p1.Click += new EventHandler(p1_click);
     p1.SizeMode = PictureBoxSizeMode.StretchImage;() 没改变图片的大小?
因为图片本身大小为 128*128 怎样才能让图片完全显示,控件的大小最大我只能给他100*100
 

------解决方案--------------------
p1.BackgroundImageLayout = ImageLayout.Stretch;