Results 1 to 7 of 7

Thread: [RESOLVED] How to create a ComboBox in an Inputbox

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Dec 2010
    Posts
    110

    Resolved [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 ??

  2. #2
    Fanatic Member amrita's Avatar
    Join Date
    Jan 2007
    Location
    Orissa,India
    Posts
    888

    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
    thanks
    amrita

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Dec 2010
    Posts
    110

    Re: How to create a ComboBox in an Inputbox

    Quote Originally Posted by amrita View Post
    You can create a custom form , set its properties to appear as a popup window.

    http://www.codeproject.com/KB/miscctrl/simplepopup.aspx


    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.)

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: How to create a ComboBox in an Inputbox

    Quote Originally Posted by Hamsori View Post
    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.

  5. #5
    Master Of Orion ForumAccount's Avatar
    Join Date
    Jan 2009
    Location
    Canada
    Posts
    2,802

    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.

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Dec 2010
    Posts
    110

    Re: How to create a ComboBox in an Inputbox

    Quote Originally Posted by ForumAccount View Post
    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.

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Dec 2010
    Posts
    110

    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
  •  



Click Here to Expand Forum to Full Width