简体   繁体   English

winforms-如何在tableLayoutPanel中移动图片框?

[英]winforms - how to move a picturebox within a tableLayoutPanel?

i tried to use panels in each cells but the picturebox still wont move to another cell. 我试图在每个单元格中使用面板,但是图片框仍然不会移动到另一个单元格。 thanks 谢谢

Use the following: 使用以下内容:

tableLayoutPanel.Controls.Remove(button1);

// then:

tableLayoutPanel.Controls.Add(pictureBox, columnIndex, rowIndex);

Read about TableLayoutPanel : 阅读有关TableLayoutPanel的信息

TableLayoutPanel tutorial on csharp-online.net csharp-online.net上的TableLayoutPanel教程


If you wanted to implement Drag and Drop , you may get used from the following references: 如果要实现拖放 ,可以从以下参考资料中使用:

A Simple Drag And Drop How To Example 一个简单的拖放操作示例

Simple drag and drop example 简单的拖放示例

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM