开发者

Control inside control with Winforms

开发者 https://www.devze.com 2023-03-13 21:46 出处:网络
Is 开发者_如何学Goit possible to put a combo box inside a list box? I\'d like to create a list (inside the list box) with each entry having a combo box next to it.No.

Is 开发者_如何学Goit possible to put a combo box inside a list box? I'd like to create a list (inside the list box) with each entry having a combo box next to it.


No.

Instead, you should use a DataGridView with a ComboBox column.


This may not be the best solution for you since it's already implemented in a DataGridView - but to answer your question, yes, it is possible.

If the listbox is named ListBox1 and the ComboBox is named ComboBox1:

ListBox1.Controls.Add(ComboBox1)

You can add new comboboxes and position them just like in a panel.

0

精彩评论

暂无评论...
验证码 换一张
取 消