VB.NET: Multiple forms

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rents
    New Member
    • Mar 2007
    • 26

    VB.NET: Multiple forms

    hello all,
    I have a project due by the end of the this week. with this particular project, we are to use "multiple forms." I'm a little shaky on this concept. So here is the description of the problem we are doing. (this is supposed to be a skateboard designer-calculator)

    "Create an application that allows the user to select one deck from a form, one truck assembly from a form , and one wheel set from a form. The application should also have a form that allows the user the select any miscellansous product, using check boxes. The application should display the subtotal, the amount of sales tax (at 6%), and the total of the order. Do not apply sales tax to assembly." In addition to the requirements, add a simple menu and a SplashScreen to the form.

    They gave us a variety of decks/wheels etc with prices. So all that information is ready. Besides creating multiple forms, what would be a good way to start the code for this one?
    Any help/suggestions is/are appreciated.
  • Killer42
    Recognized Expert Expert
    • Oct 2006
    • 8429

    #2
    The experts on this site are more than happy to help you with your problems but they cannot do your assignment/program for you. Attempt the assignment/program yourself first and post questions regarding any difficulties you have or about a particular function of the code that you don't know how to achieve.

    Please read the Posting Guidelines and particularly the Coursework Posting Guidlines.

    Then when you are ready post a new question in this thread.

    MODERATOR

    Comment

    • rents
      New Member
      • Mar 2007
      • 26

      #3
      I apologize. I really wasn't looking for anyone to actually do the work for me. I asked where/how I should start. If that is a problem, then I understand.
      I had a project the other week and I posted pretty much the same way. I explained the problem I was working on and no one said I coulnd't start it out that way.
      Regardless, I apologize if I violated the terms.

      Comment

      • Killer42
        Recognized Expert Expert
        • Oct 2006
        • 8429

        #4
        Originally posted by rents
        I apologize. I really wasn't looking for anyone to actually do the work for me. I asked where/how I should start. If that is a problem, then I understand.
        I had a project the other week and I posted pretty much the same way. I explained the problem I was working on and no one said I coulnd't start it out that way.
        Regardless, I apologize if I violated the terms.
        Yeah sorry, that's a standard response we're supposed to post for any homework questions. Sometimes it seems a bit over the top.

        The problem is, we get tons of people who simply paste in a homework assignment and add "please send me the code". This causes ethical problems for us, and it doesn’t help them if we do it, since they haven’t learned the subject, just copied someone else’s work. Plus, since the professors and so on also know about sites like this, students have been caught at this sort of thing in the past, and ended up being failed as a result.

        That being said, I believe you’ll find most people here will be happy to try and help you understand the subject, as long as you are making a serious effort.

        As for using multiple forms, I think you may need to fill us in a bit more on what the problem is. But here are a couple of general tips...

        If you can create a form, then you can create another one just as easily, so I'll assume creating the forms isn't a problem. Passing data between forms would generally use one of two methods. Either your code (anywhere in the project) explicitly refers to the controls on the form to access their properties (such as MyString = Form1.Text1.Tex t), or you define Public variables in a code module (not a form), and use them to hold information so you can use it anywhere in your code.

        Comment

        • rents
          New Member
          • Mar 2007
          • 26

          #5
          Thanks Killer. I guess we just had a miscommunicatio n..or at least I did :)

          I've created mulitple forms and have succesfully coded them so they open from the prompt on the main form.
          The probelm I'm having now is something you kind of touched on in you last post...

          For this skateboard designer, I have four additional forms (trucks, wheels, decks, and miscellaneous) Let's take the trucks form.
          On there I have a drop down menu with three selections and a button labeled "Ok" (as in "you have made your choice)
          I was going to use "select case" to have the user's selection go to the main form where there is a label waiting for the input (does this make sense? :) )

          So right now, that's what I'm stuck on

          Comment

          • rents
            New Member
            • Mar 2007
            • 26

            #6
            I think I would have to use a modual too? (Did I spell that the right way?)

            Comment

            • SammyB
              Recognized Expert Contributor
              • Mar 2007
              • 807

              #7
              Originally posted by rents
              Thanks Killer. I guess we just had a miscommunicatio n..or at least I did :)

              I've created mulitple forms and have succesfully coded them so they open from the prompt on the main form.
              The probelm I'm having now is something you kind of touched on in you last post...

              For this skateboard designer, I have four additional forms (trucks, wheels, decks, and miscellaneous) Let's take the trucks form.
              On there I have a drop down menu with three selections and a button labeled "Ok" (as in "you have made your choice)
              I was going to use "select case" to have the user's selection go to the main form where there is a label waiting for the input (does this make sense? :) )

              So right now, that's what I'm stuck on
              Is this VB6 or VB.NET?

              Comment

              • Killer42
                Recognized Expert Expert
                • Oct 2006
                • 8429

                #8
                Originally posted by SammyB
                Is this VB6 or VB.NET?
                Excellent question, Sammy.

                rents, assuming VB6, you will need to create a module to hold any Public variables. It depends whether you want to use public variable to share the data, or just refer directly to the controls on the different forms, as I mentioned before.

                And I don't really see how a Select Case would be involved there. When the user clicks OK, shouldn't the Click event procedure simply take the selection and place it in either a public variable or a control on the main form?

                Comment

                • SammyB
                  Recognized Expert Contributor
                  • Mar 2007
                  • 807

                  #9
                  Originally posted by Killer42
                  Excellent question, Sammy.

                  rents, assuming VB6, you will need to create a module to hold any Public variables. It depends whether you want to use public variable to share the data, or just refer directly to the controls on the different forms, as I mentioned before.

                  And I don't really see how a Select Case would be involved there. When the user clicks OK, shouldn't the Click event procedure simply take the selection and place it in either a public variable or a control on the main form?
                  That's why I'm thinking that Rents is using VB.NET. It's a lot different there. http://www.thescripts.com/forum/thread614534.html when through most of the Net form communication schemes, but the code was in C#. If Rents is using VB.NET, I can translate.

                  Comment

                  • rents
                    New Member
                    • Mar 2007
                    • 26

                    #10
                    sorry guys, yeah I'm using vb.NET..please continue

                    Comment

                    • SammyB
                      Recognized Expert Contributor
                      • Mar 2007
                      • 807

                      #11
                      Originally posted by rents
                      sorry guys, yeah I'm using vb.NET..please continue
                      Finally found where I explained this before, http://www.thescripts.com/forum/post2465195-7.html. I think that it makes the process of using two forms clear, but the original poster did not: I think that he just wanted us to write his code. So, follow the link, do the example, just as it is written. Then, try to apply it to your project. It is also possible for two forms to communicate by means of an event, but it is complicated and I don't think that you need to do that. Let us know how you are progressing. Unfortunately, I will be without a computer until Monday, so you are on your own. Hope it goes well! --Sam

                      Comment

                      • rents
                        New Member
                        • Mar 2007
                        • 26

                        #12
                        Thanks Sam. I'll check out that link and let you know how things turn out.

                        Comment

                        • bellam31
                          New Member
                          • Aug 2008
                          • 4

                          #13
                          Hey, I have a question on multiple forms too.

                          Iv just been chucked into a Visual C# project at work even though I usually only code in Java.

                          I need to open a new form when an event happens but I keep getting errors.

                          Iv tried form2.Show;

                          and

                          Dim secondForm as new Form2;
                          secondForm.Show ();

                          Any advice on what will actually work?

                          Comment

                          Working...