Results 1 to 3 of 3

Thread: Need help with reset variables

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2013
    Posts
    1

    Need help with reset variables

    I am building a program based on forms. I created few forms and declare public variables to calculate price which is displayed when one of that form is load based on values from previous forms.
    I will do loop back to first form but when I do that all variables are not resetting.

    I done this way:

    frm_name.visible = true
    me.visible = false

    Please give me some advice please.
    If somebody is interested I email that program.

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: Need help with reset variables

    Welcome to VBForums

    Thread moved from the 'Contests' forum to the 'VB.Net' (VB2002 and later) forum

    For the benefit of others, Lukasz-Z's profile says VB 2010

  3. #3
    PowerPoster stanav's Avatar
    Join Date
    Jul 2006
    Location
    Providence, RI - USA
    Posts
    9,290

    Re: Need help with reset variables

    Hiding and showing a form doesn't reset any variable values. If you want to reset some certain variables while keeping some others, you have to do it manually. On the other hand, if you want to reset all variables, just close the form and recreate a new instance of the form again.
    Code:
    'close the form
    form_name.Close()
    
    'Then show the form again
    form_name.Show()
    'Or this
    Dim myform As New form_name()
    myform.Show()
    Last edited by stanav; May 1st, 2013 at 02:47 PM.
    Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
    - Abraham Lincoln -

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