How do i remember the values entered by a user when i hit the "Back" Button

Beginner

Well-known member
Joined
Mar 12, 2008
Messages
114
Programming Experience
Beginner
The pictures explain clearly what im trying to do.

2003991706068071907_rs.jpg


2003938782453444364_rs.jpg


2003951062955383046_rs.jpg


So how can i let the values entered by the user to be there ?

The code i have in the back button is

VB.NET:
        Dim f1 As New Form1
        Me.Hide()
        f1.Show()

What should i add or what shall i do to prevent getting the values wiped out?
I think i have to pass the values or store them in the back button When i press on calculate. Im not sure how to do so.

This is the code i have in the button "Calculate"

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

        second.Show()
        Me.Hide()


    End Sub
End Class
 
Last edited:
VB.NET:
        Dim f1 As [B][COLOR="Black"][SIZE="5"]New [/SIZE][/COLOR][/B]Form1
        Me.Hide()
        f1.Show()

Your question is kinda like you drinking half the milk in the fridge, then buying a new bottle of milk and saying "oh.. why isnt the new bottle half drunk?"

Erm. Because it's new?

What should i add or what shall i do to prevent getting the values wiped out?
Spend more time planning and thinking, and less time coding.. Though I do agree that weeks of coding can save you hours of planning.


This is the code i have in the button "Calculate"
Uhuh, and is this on your New form, or your old one?
 
If you don't need multiple instances of Form1 don't create new ones, just use the default instance by calling Form1.Show()/Form1.Hide() directly. (also give it a name, "Form1"?? ;))
 
Your question is kinda like you drinking half the milk in the fridge, then buying a new bottle of milk and saying "oh.. why isnt the new bottle half drunk?"

Erm. Because it's new?


Spend more time planning and thinking, and less time coding.. Though I do agree that weeks of coding can save you hours of planning.



Uhuh, and is this on your New form, or your old one?



Thanks a MILLION + a MILLION MORE


The reason why i used
Dim f1 As New Form1
Is that i coppied the code from somewhere without understanding the logic.
Now i got it.

12cj9.gif



i'll change the font buttons to match the same font as in the first form.

So Now ive limited the number of fonts to 2. let me know what u think.
 
Back
Top