Link Labels c# - displaying a list of them

后端 未结 2 596
余生分开走
余生分开走 2021-01-20 17:03

I am trying to add a list of linked lables to a listview. I amd doing so like this

        foreach (String s in values)
        {
            LinkLabel label         


        
相关标签:
2条回答
  • 2021-01-20 17:23

    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.

    0 讨论(0)
  • 2021-01-20 17:29

    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.

    0 讨论(0)
提交回复
热议问题