Link Labels c# - displaying a list of them

北战南征 提交于 2019-12-01 21:17:39

Neither the ListView or ListBox controls are really designed to host child controls.

If that's what you need, then you should be using a container control, such as a Panel. I recommend using either a TableLayoutPanel or a FlowLayoutPanel that can automatically manage the layout of its child controls.

I tried your code. What you are doing is adding control to listitem and not items.

Thus, when you check => txtbox.Items.Count = 0; and txtbox.Controls.Count = 2 after the for loop.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!