PC Review
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Compact Framework
Architecture meditations...
Forums
Newsgroups
Microsoft DotNet
Microsoft Dot NET Compact Framework
Architecture meditations...
![]() |
Architecture meditations... |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
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 |
|
|
|
#2 |
|
Guest
Posts: n/a
|
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 > |
|
|
|
#3 |
|
Guest
Posts: n/a
|
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. |
|
|
|
#4 |
|
Guest
Posts: n/a
|
|
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

