0

I am currently teaching myself how to code and I have come across something difficult. I have a form with 1 button (btnCreateNew) and 1 ListBox (listBox1). My goal is to create a new ComboBox within the ListBox every time I click on the Button. I only need 2 items in the ComboBox (Create New File and Delete File). I cant seem to figure this out and any help would be very much appreciated. I am trying to do this using Visual Basic (VB.Net). Thank you in advance.

5
  • 1
    Creating a ComboBox inside a ListBox seems to make little sense. The items you say you want inside it don't help it make sense in this case. Can you explain what you're actually trying to achieve, rather than how you're trying to achieve it? What's the workflow here? I'm confident that there's a better way than what you suggest. For the record, please edit the question to provide a FULL and CLEAR explanation of the problem, rather than adding a comment. No one should have to read the comments to understand the question. Commented Jul 28, 2024 at 5:16
  • 1
    For the record, assuming that this is WinForms, the reason you can't find an easy way to do it is because it's not something people do. If it's possible at all, you'd have to do all sorts of under-the-hood fiddling. Commented Jul 28, 2024 at 5:20
  • Use DataGridView instead so you can have one or more DataGridViewComboBoxColumn. Don't waste your time. Good luck. Commented Jul 28, 2024 at 5:20
  • in WinForms there is a CheckedListBox. You can't do that with a regular ListBox unless you are using WPF which is a whole different story. Also, it is not clear why you are using the drop-down-menu and combobox tags (and winforms is missing). Commented Jul 28, 2024 at 15:18
  • Thanks for the responses. After reading the comments what i was trying to achieve can be achieved using the DataGridView. Now that i have an understanding of the DataGridView what i was originally trying to do was to click on an ADD button and when i do, a combobox would appear in my DataGridView and within that combobox i would be able to select a different number of items (item 1, item 2, etc). Thats what Im trying to achieve at the moment. Commented Oct 23, 2024 at 3:04

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.