Question:

Can anyone asist me wif VB??

by Guest65165  |  earlier

0 LIKES UnLike

actually i wanted to make 2 forms.. we name it old form and new form. There's a next button on the old form when i press it it will bring out new form and the old form disappear. And when i click back from new form, the new form will disappear and the old form will come out and will be refreshed. Can it be done?? Can anyone guide me through??

 Tags:

   Report

2 ANSWERS


  1. Old_fom add a command button and write the following in the button click sub :

    Old_form.hide

    NewForm.show

    New_fom add a command button and write the following in the button click sub :

    Old_from.refresh

    NewForm.Hide

    Old_form.show


  2. You can do it, each form will have to have a reference to the other this can be down easily.

    In NEWFORM create an instance of OLDFORM in the constructor of OLDFORM pass it a reference of NEWFORM.

    So when you are in NEWFORM and press a button you will call:

    NEWFORM.HIDE();

    if(OLDFORM == null)

      OLDFORM = new OLDFORM(ref NEWFORM);

    OLDFORM.SHOW();

    And when you press the button in OLDFORM you will call

    OLDFORM.HIDE();

    // Keeping in mind that NEWFORM is parameter passed by reference rather than value

    NEWFORM.SHOW();

Question Stats

Latest activity: earlier.
This question has 2 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.