|
-
Jun 13th, 2011, 05:49 AM
#1
Thread Starter
Lively Member
[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 ??
-
Jun 13th, 2011, 06:19 AM
#2
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
-
Jun 13th, 2011, 06:56 AM
#3
Thread Starter
Lively Member
Re: How to create a ComboBox in an Inputbox
 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.)
-
Jun 13th, 2011, 06:58 AM
#4
Re: How to create a ComboBox in an Inputbox
 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.
-
Jun 13th, 2011, 01:21 PM
#5
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.
-
Jun 14th, 2011, 12:51 AM
#6
Thread Starter
Lively Member
Re: How to create a ComboBox in an Inputbox
 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...
Last edited by Hamsori; Jun 14th, 2011 at 01:16 AM.
-
Jun 14th, 2011, 04:23 AM
#7
Thread Starter
Lively Member
Re: How to create a ComboBox in an Inputbox
Done!
Thanks for all your responses!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|