Architecture meditations...

  • Thread starter Thread starter SammyBar
  • Start date Start date
S

SammyBar

Hi,

I'm developing a very simple application. It has three forms: Login, a
Search form and a DataCapture form. Only one form can be active at any given
time. Login form is used once, after authentication it is not needed. Then
the user will be switching between data capture and search. I'm thinking on
how the forms should call each other in order to the Running Program List on
the device show only one form. I can run the message loop on the Search
form, then load and close Login and Data Capture. But it will cause when
DataCapture form is on, the Running Program List of the device will show
both forms and I need it only showed the data capture. I can not close the
Search form 'cause it contains the application message loop and it will
cause the application to be ended... I'd like some architecture in which I
could switch from form to form by closing them and recreating when needed,
like a web browser switching from page to page, but all they contained in a
single application.

Any hint is welcomed
Thanks in advance

Sammy
 
I do something similar.

Show a Login form
Verify the login info and then show the data collection form, and hide the
login form.

With my Search form I have changed Sub New to accept the calling form.

Public Sub New(ByVal newCallingForm As frmVehicleDesc)
MyBase.New()

'This call is required by the Windows Form Designer.
InitializeComponent()

'Add any initialization after the InitializeComponent() call
callingForm = newCallingForm
End Sub

and on the form that will call the search form

' Declare the Search Form here so we can call it from
' this form and be able to pass info back to this form as the calling
form
Private frmSearchData As New frmSearch(Me)

Then you can just Show and Hide the search form and pass any data back to
the calling form

Maybe no the most elegant of solutions but it works.

Cheers

Robert
 
We use something like this:

void Navigate (Form from, Form to) {
to.Show();
from.Hide();
}

It prevents multiple entries in the task manager. However it addresses
only half of your problem.
 
Back
Top