我正在尝试创建一个可选择的滚轮,其中FlowLayoutPanel
中所选的子对象的大小会增加。
如何在动态创建对象后增加FlowLayoutPanel
内对象的大小?
class CustomFlowLayout : FlowLayoutPanel
{
public List<Node> ChildList = new List<Node>();
Node SelectedNode = new Node();
public CustomFlowLayout(){ }
//
//Methods
//
public void DrawList()
{
if (this.ChildList.Count == 0)
{
MessageBox.Show("No Systems found");
}
else
{
SelectedNode = ChildList[0];
for (int i = 0; i < ChildList.Count; i++)
{
PictureBox CurrentPic = new PictureBox();
CurrentPic.Name = ChildList[i].Name;
CurrentPic.Width = 400;
CurrentPic.Height = 200;
CurrentPic.Image = ChildList[i].NodePicture;
this.Controls.Add(CurrentPic);
}
}//end else
}//end DrawList()
}//end Class
节点类
namespace Nostalgia{
class Node
{
public bool isSelected = false;
public string Name;
public Bitmap NodePicture;
public int ListPosition;
//
//Constructors
//
public Node() { }
}