6 Replies - 357 Views - Last Post: 08 April 2011 - 07:56 AM Rate Topic: -----

#1 fre34y  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 30-March 11

Can you have two forms with the output display carrying on to the next

Posted 08 April 2011 - 06:14 AM

I have several forms, the first one the user chooses the pizza type, size and topping, the second they choose the side orders such as chip, garlic bread etc and the third, the user choose the drinks, the last form is the summary form which i want it to display everything the user chose and the overall total.

So for this i want on each form the thing they chose and the price. For example form 1, user chooses 8" Maryland with onions, then they click subtotal button, this adds it up, then they click next to go to the next form and when the user clicks the button for chip it is displayed with the pizza that was displayed on previous form and is added to that subtotal etc. At the mo I can get on each form the the output being displayed but i do not know how to get the output from the previous to already be in the second form.

Has anyone any idea on how to make this possible?

so really for ever form i want the output boxes to be linked.

ps. I have attached a very quick print screen of what my program looks like for each form to give a better understanding.

Thanks

Is This A Good Question/Topic? 0
  • +

Replies To: Can you have two forms with the output display carrying on to the next

#2 Macjohn  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 80
  • View blog
  • Posts: 407
  • Joined: 10-April 09

Re: Can you have two forms with the output display carrying on to the next

Posted 08 April 2011 - 06:25 AM

little question.Why would you use 3different forms if you can use just one?...
Was This Post Helpful? 0
  • +
  • -

#3 fre34y  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 30-March 11

Re: Can you have two forms with the output display carrying on to the next

Posted 08 April 2011 - 06:51 AM

Simply just because I have to make a program, for my HCI module and it has to be neat and not too complex looking.

However if I thought this is very impossible I will just have to change it all and its looking that way unfortunately!
Was This Post Helpful? 0
  • +
  • -

#4 fre34y  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 30-March 11

Re: Can you have two forms with the output display carrying on to the next

Posted 08 April 2011 - 07:19 AM

I decided that I will just try and put it on same form but, there is really not enough room to make it neat looking, so if anyone knows the answer to my question, it would be much appreciated!
Was This Post Helpful? 0
  • +
  • -

#5 Macjohn  Icon User is offline

  • D.I.C Regular
  • member icon

Reputation: 80
  • View blog
  • Posts: 407
  • Joined: 10-April 09

Re: Can you have two forms with the output display carrying on to the next

Posted 08 April 2011 - 07:28 AM

if you have two forms the the first one (name it Form1) include one textbox control and button , and when pressing button you want to pass the textbox text to the second form (name it Form2)

this code should go on form2

   
      Private _passedText As String
   
        Public Property [PassedText]() As String
      Get
      Return _passedText
      End Get
      Set(ByVal Value As String)
      _passedText= Value
      End Set
      End Property



Then , when you are declaring Object from Form2 you just set The Value before Showing the Form

in the Form1 and in Button1 Click event write these lines :

      Dim Obj As New Form2
      Obj.PassedText = TextBox1.Text
      Obj.Show



By the way...I'm not a vb expert or anything, I just searched a bit...

This post has been edited by Macjohn: 08 April 2011 - 07:30 AM

Was This Post Helpful? 0
  • +
  • -

#6 fre34y  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 8
  • Joined: 30-March 11

Re: Can you have two forms with the output display carrying on to the next

Posted 08 April 2011 - 07:47 AM

I have tried that code and there is no errors however it is not doing anything that I can see. Unfortunately I have to go to work now so I will have to take a closer look at this tonight! Could you send me the web address of where you got this info as that might help, thanks.
Was This Post Helpful? 0
  • +
  • -

#7 trevster344  Icon User is offline

  • The Peasant
  • member icon

Reputation: 224
  • View blog
  • Posts: 1,499
  • Joined: 16-March 11

Re: Can you have two forms with the output display carrying on to the next

Posted 08 April 2011 - 07:56 AM

View Postfre34y, on 08 April 2011 - 07:47 AM, said:

I have tried that code and there is no errors however it is not doing anything that I can see. Unfortunately I have to go to work now so I will have to take a closer look at this tonight! Could you send me the web address of where you got this info as that might help, thanks.


By the sounds of it you probably didn't do anything with the value after you received it.

If you are using a button try doing something with the value you just grabbed.

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Msgbox([PassedText])

End Sub



Or try on the loading of the form

    Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Label1.Text = [PassedText]
    End Sub



The code works just fine. By the way, try posting some code when you need help, especially the code around your problem. It can really help! :)

This post has been edited by trevster344: 08 April 2011 - 07:59 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1