大家好 希望一切都好
我想知道(挣扎)以下内容:
我有 5 个 flowLayoutPanel 和 5 个 PictureBoxes 我希望能够在运行时将任何图片框移动到任何 FLP 上,并让布局面板将其添加到 FLP.controls.Add()....
我已经做了好几个小时了,现在我要吞下我的骄傲了——
我已经完成了以下操作以使其正常工作,但在这里我必须手动指定哪个 PixBox 与哪个 FLP 相交,并且我不想要 25 个 if 语句
Private Sub cpbPic1_MouseUp(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles cpbPic1.MouseUp
If (flpDock1.HasChildren = False) Then 'Test to see if panel is filled
If CBool(CustomPictureBox.IntersectingObjects(cpbPic1, flpDock1)) Then
flpDock1.Controls.Add(cpbPic1) 'Add Pic to Panel
End If
End Sub
cpb:自定义图片框