Re: Displaying forms

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



"dpb" <none@xxxxxxx> wrote in message news:h0ri66$qii$1@xxxxxxxxxxx
Melvin wrote:
I have continuing difficulty understand just how and when a form is displayed. The specifics this time is as follows:

I have two forms. Form1 and Form2

Form1 is displayed and at some point, based on user input ,I want to hide Form 1, switch to Form 2, display it and run the only procedure (GetPrices) contained in it then unload it and return to Form 1 and make it visible and continue processing.

There is no user input on Form2, only a label with fixed data.
...
Not sure _why_ you would choose to do it this way, but...

The one thing you'll have to be sure to do is to have the function that calls the second form redisplay the form that _does_ have some user interaction on it or you'll be stuck showing that label until kill the app.

Add a command button to Form1 and a Label to Form2 in a project and paste into their respective forms..

Private Sub Command1_Click()
Dim PauseTime, Start
Form1.Hide
Form2.Show
Form2.Form2Sub
PauseTime = 5 ' Set duration.
Start = Timer ' Set start time.
Do While Timer < Start + PauseTime
DoEvents
Loop
Form2.Hide
Form1.Show
End Sub

Sub Form2Sub()
Form2.Label1 = "New Text From Form2"
End Sub

--

Please see my reply to Larry above. Maybe this would help you understand why I believed this way the only way to do what I am attempting to do.

Mel

.



Relevant Pages

  • Re: Displaying forms
    ... Form1 and Form2 ... Form 1, switch to Form 2, display it and run the only procedure ... There is no user input on Form2, only a label with fixed data. ...
    (microsoft.public.vb.general.discussion)
  • Re: Displaying forms
    ... Form1 and Form2 ... Form 1, switch to Form 2, display it and run the only procedure ... There is no user input on Form2, only a label with fixed data. ... Private Sub Command1_Click ...
    (microsoft.public.vb.general.discussion)
  • Re: Displaying forms
    ... Form1 is displayed and at some point, based on user input,I want to hide Form 1, switch to Form 2, display it and run the only procedure contained in it then unload it and return to Form 1 and make it visible and continue processing. ... There is no user input on Form2, only a label with fixed data. ... Private Sub Command1_Click ...
    (microsoft.public.vb.general.discussion)
  • Re: Displaying forms
    ... Form1 and Form2 ... Form 1, switch to Form 2, display it and run the only procedure ... There is no user input on Form2, only a label with fixed data. ... Control 6.0 on the form that executes the lookup to be able to work That ...
    (microsoft.public.vb.general.discussion)
  • Re: creating a vb.net project with multiple forms
    ... Place the following code in the Click event procedure of the button on Form1 ... Dim my2 As New Form2 ... 'Display new instance ...
    (microsoft.public.dotnet.general)