Help with my program RRS feed

  • Question

  • Hello, I'm not sure if this is the right topic to ask this in (Apologies if it's not)

    My boss just recently asked me to write a program for him, I figured Visual Basic would be best to get done what he wants.

    I've coded in vb before but it's been quite a while and I only ever learned the more basic stuff.

    Below is a picture of how the form is supposed to look.

    Basically what I need is this: as soon as the form loads I want a pop-up window on which I can make a selection (So regular buttons or radiobuttons... (5 buttons))

    And based on what I pick I want the corresponding pick to be displayed in 'title'.

    I completely forgot the code to create this pop-up window in form.load so I kind of need help there, I'd also like to know if it's possible to get the mentioned buttons in there.

    Next I'm going to have to work with Arrays or Tabels... Let's say one of those buttons is called 'pipes' and I click it, then I want a list of all kinds of pipes (Which were stored in an array/table) to show up in txtChooseItem. I'm wondering if it's possible to load these from an excel file or something.

    I think coding wise this won't be THAT much, gonna take a lot of time filling in the arrays/tables... I just can't remember most of the commands...

    The 2nd textbox is just a specification of what you select in the first one, so what diameter the pipe needs to be, or what colour, etc...

    So I'm gonna need an array/table for that as well but if I know how the first one works, I can work something out for that one as well.

    Hope someone can help me with this

    Thanks in advance

    • Edited by RayenKlima Friday, March 9, 2012 9:16 AM
    Friday, March 9, 2012 9:15 AM


All replies

  • Eh, sorry for the wall of text, pressing enter doesn't seem to work.

    Hope it's still clear...

    Friday, March 9, 2012 9:17 AM
  • Well I managed to fix the first problem by creating a second form and loading it through form1.load...

    As well is sending it to the title label.

    Now I need to figure out how to send a list of information from excel into a listbox, this may require a bit of help.

    Friday, March 9, 2012 2:21 PM
  • Hi RavenKlima,

    To import from excel to listbox, you can refer to this thread with a well coded demo Import Excel column into Listbox of C#, it is given by C#, but you can translate it to VB.net by a converter like http://www.developerfusion.com/tools/convert/csharp-to-vb/.

    Hope this helps.


    Helen Zhou [MSFT]
    MSDN Community Support | Feedback to us

    • Marked as answer by Helen Zhou Tuesday, March 27, 2012 7:27 AM
    Monday, March 12, 2012 6:24 AM
  • Well, problem is I can't follow what he does and if it errors out (which it does) I have no idea how to fix it.

    I think what would be best is a tutorial that starts from the beginning...

    What it needs to do is this:

    -I have 2 forms, when I press one of five buttons on form2 I want a corresponding list to be shown in a listbox in form1.

    How this happens I can work out by first loading it into an invisible listbox in form2 and then transfer it to form1, I can do that.

    But how do I load in the lists (from excel) into the listbox on form2?

    Edit: I found a 'Listbox.additem' command somewhere, but, I'm using VB 2010 and it doesn't seem to recognize the 'additem'
    Did this change into a new command because I can't find it and debug doesn't give me a solution.
    • Edited by RayenKlima Monday, March 12, 2012 11:46 AM
    Monday, March 12, 2012 10:33 AM
  • Yes, ListBox.Additem is for VB6 only, to add item for listBox in VB.net, you may use ListBox1.Items.Add(); like in http://msdn.microsoft.com/en-us/library/system.windows.forms.listbox.items.aspx

    Helen Zhou [MSFT]
    MSDN Community Support | Feedback to us

    • Edited by Helen Zhou Monday, March 19, 2012 9:56 AM
    • Marked as answer by Helen Zhou Tuesday, March 27, 2012 7:27 AM
    Monday, March 19, 2012 9:55 AM