foreach (System.Windows.Forms.Control control in this.groupBox2.Controls)//遍历groupBox2上的所有控件   

 {      

    if (control is System.Windows.Forms.PictureBox)     

     {       

      System.Windows.Forms.PictureBox pb = (System.Windows.Forms.PictureBox)control;       

      pb.AllowDrop = true;     

     }

     

if (cl is CheckBox)
{
Label lab = cl as Label;
lab.Enabled = false;//在这里设置
}

 }  

 

 

  1. foreach (System.Windows.Forms.Control control in this.Controls)//遍历Form上的所有控件  
  2.    {  
  3.     if (control is System.Windows.Forms.PictureBox)  
  4.     {  
  5.      System.Windows.Forms.PictureBox pb = (System.Windows.Forms.PictureBox)control;  
  6.      pb.AllowDrop = true;  
  7.     }  
  8.    }  

相关文章:

  • 2022-12-23
  • 2021-10-20
  • 2022-12-23
  • 2021-12-02
  • 2021-10-27
  • 2022-12-23
  • 2022-12-23
  • 2021-12-01
猜你喜欢
  • 2022-12-23
  • 2021-08-26
  • 2021-11-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案