[RESOLVED] How to create a ComboBox in an Inputbox
I have a problem with inserting a multiple selection option into my Inputbox.
IDEA:
First the user chooses an excel file which he wants to open and then the sheet he wants to be read.
I can manage everything else except making the sheet selection a multiple option one.
At the moment the name of the wanted Excel sheet is typed into the text field in the inputbox. But I want the textfield to be a dropdownlist which would be populated with this:
Code:
With ComboBox1
For i As Integer = 1 To XL_WB.Worksheets.Count
Dim nimet As Excel.Worksheet = XL_WB.Worksheets(i)
.Items.Add(nimet.Name)
Next
End With
(XL_WB is my Excel.Workbook)
So, does anyone have an idea or a syntax ready for how to create an Inputbox with Textfield --> ComboBox ?? :confused:
Re: How to create a ComboBox in an Inputbox
You can create a custom form , set its properties to appear as a popup window.
http://www.codeproject.com/KB/miscctrl/simplepopup.aspx
Re: How to create a ComboBox in an Inputbox
Quote:
Originally Posted by
amrita
Ok. Will try to do it that way.
(The link you provided shows some tips in C#, I'm working with VB.)
How can I code the Form to be a pop-up? (Always on top when activated.)
Re: How to create a ComboBox in an Inputbox
Quote:
Originally Posted by
Hamsori
How can I code the Form to be a pop-up? (Always on top when activated.)
No code necessary...set the TopMost property of the Form to True.
Re: How to create a ComboBox in an Inputbox
I think the desired effect the OP is looking for is a dialog effect. If he is using a custom input box for the requirements of waiting for input, such as the MessageBox, he will need to use the ShowDialog method of the Form so that the Form will deny deactivating until the user does something, i.e. press Cancel or OK.
Re: How to create a ComboBox in an Inputbox
Quote:
Originally Posted by
ForumAccount
I think the desired effect the OP is looking for is a dialog effect. If he is using a custom input box for the requirements of waiting for input, such as the MessageBox, he will need to use the
ShowDialog method of the Form so that the Form will deny deactivating until the user does something, i.e. press Cancel or OK.
Yep. That's exactyly right... Still trying to get it working completely, but have a few snags...
Re: How to create a ComboBox in an Inputbox
Done!
Thanks for all your responses!