PC Review Forums Newsgroups Microsoft DotNet Microsoft Dot NET Compact Framework Architecture meditations...

Reply

Architecture meditations...

 
Thread Tools Rate Thread
Old 17-01-2006, 03:20 PM   #1
SammyBar
Guest
 
Posts: n/a
Default Architecture meditations...


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


  Reply With Quote
Old 18-01-2006, 04:02 AM   #2
Robert J
Guest
 
Posts: n/a
Default Re: Architecture meditations...

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

"SammyBar" <sammybar@gmail.com> wrote in message
news:eoHSJl3GGHA.3000@TK2MSFTNGP14.phx.gbl...
> 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
>



  Reply With Quote
Old 18-01-2006, 09:15 AM   #3
tamberg
Guest
 
Posts: n/a
Default Re: Architecture meditations...

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.

  Reply With Quote
Old 18-01-2006, 09:27 AM   #4
tamberg
Guest
 
Posts: n/a
Default Re: Architecture meditations...

  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off