首页
学习
活动
专区
圈层
工具
发布
  • 您找到你想要的搜索结果了吗?
    是的
    没有找到

    C#中PictureBox没有AllowDrop属性怎么办

    有时候我们需要拖拽图片到图片控件直接显示,发现PictureBox没有显示AllowDrop属性,而且使用picturebox1也点不出来。其实这个控件是有这个属性的,直接写出来而不能点出来。...看下面经典对话 private void pictureBox1_DragOver(object sender, DragEventArgs e) { if ((e.AllowedEffect &....Image = img; } } 在窗体构造函数或者是Load事件里写下面三行 this.pictureBox1.DragOver+=new DragEventHandler(pictureBox1..._DragOver); this.pictureBox1.DragDrop+=new DragEventHandler(pictureBox1_DragDrop); this.pictureBox1....AllowDrop = true; 代码已经经过测试,没有问题 PictureBox的AllowDrop属性确实感知不出来,但是PictureBox类中含有对这个属性的定义,你可以Go To

    15000
    领券