【问题标题】:swap picturebox in drag and drop在拖放中交换图片框
【发布时间】:2014-02-26 07:05:16
【问题描述】:

您好,我一直在尝试通过拖放在两个 PictureBox 之间进行交换,我用来进行拖放的代码是 C# Drag and Drop from one Picture box into Another

但是我有 9 个图片框,我需要动态交换,无法从图像的来源获取图片框的名称,因此我可以进行交换,希望对这个主题有所帮助。

【问题讨论】:

    标签: c# drag-and-drop


    【解决方案1】:

    一个全局变量会像这样做你的事;

    PictureBox from;
    

    当从 picturebox1 开始拖动时;

    From = picturebox1;
    

    当从 picturebox2 开始拖动时;

    From = picturebox2;
    

    当拖放图片框时,from 变量将成为图像源

    【讨论】:

      猜你喜欢
      • 2015-03-13
      • 2023-03-20
      • 2013-11-05
      • 2013-10-25
      • 1970-01-01
      • 2020-01-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多