Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试将图片框从一个面板移动到 Windows 窗体上,然后再移动到另一个面板上。
我可以通过操纵 .left 和 .top 来使图片框移动,但是当它到达它所在的面板顶部时,图片框就会消失在板上。我怎样才能顺利离开面板,进入主窗体,然后进入面板2?
我遇到了这个问题,我有一个解决方案。这是代码:
Panel2.Controls.Add(Picturebox) 'This "Picks Up" the Picturebox from Panel1 and drops it on Panel2
此外,如果您有多个图片框,请执行以下操作:
For Each pctrbox in Panel1.Controls Panel2.Controls.Add(pctrbox) Next