473,406 Members | 2,352 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Displaying forms in an array without closing each form

JW
Dear NG,

Still working on my .NET CF C# forms application ...

I have an array of forms that I wish to display in array order, and thus
have created a loop to run through them. Due to functional and speed
reasons (this app. will be deployed to a PocketPC) I want to merely Hide()
each form when the user is finished with it, rather than allow it to
Close(). In this way the user can "back" button their way back to each
previous form which has retained its state (functional), and each form is
only created once rather than a constant create/destroy demand on the
(small) processor (speed).

Problem: if I call ShowDialog() on each form I have to call Close() for each
form to return control to the array so that the next form can be displayed.
If I only call Show() the resulting form is not modal and so the array loop
goes on its merry way displaying the next (and the next, and the next etc.)
form.

At this point I am assuming that the solution will involve creating a new
thread in which to display each form, whilst the main thread waits to be
notified that it can continue? (because this is maybe how I would approach
the problem in Java?)

Is there some way to achieve this that I am missing or do I have to thread
my way out of this one?

Many TIAs,

James.
Nov 16 '05 #1
9 1709
JW,

In your message is something that triggers me. Constructing a form cost
time.
I think that is not true when you compare that with painting a form.

The constructing will normaly be a fraction from the painting in every
system.

That to let you think in another way before you create a memory consuming
solution on your pocket PC.

Cor
Nov 16 '05 #2
JW,

In your message is something that triggers me. Constructing a form cost
time.
I think that is not true when you compare that with painting a form.

The constructing will normaly be a fraction from the painting in every
system.

That to let you think in another way before you create a memory consuming
solution on your pocket PC.

Cor
Nov 16 '05 #3
JW
Cor,

Many thanks for your reply.

Even if I factor in your comments about the cost of construction versus the
cost of repainting, isn't the cost of repainting incurred regardless of
whether or not I construct new forms all the time or reuse existing ones?
That is, any new form needs to be painted (made visible) for the first time
anyway?

James.

"Cor Ligthert" <no************@planet.nl> wrote in message
news:ur**************@TK2MSFTNGP10.phx.gbl...
JW,

In your message is something that triggers me. Constructing a form cost
time.
I think that is not true when you compare that with painting a form.

The constructing will normaly be a fraction from the painting in every
system.

That to let you think in another way before you create a memory consuming
solution on your pocket PC.

Cor

Nov 16 '05 #4
JW
Cor,

Many thanks for your reply.

Even if I factor in your comments about the cost of construction versus the
cost of repainting, isn't the cost of repainting incurred regardless of
whether or not I construct new forms all the time or reuse existing ones?
That is, any new form needs to be painted (made visible) for the first time
anyway?

James.

"Cor Ligthert" <no************@planet.nl> wrote in message
news:ur**************@TK2MSFTNGP10.phx.gbl...
JW,

In your message is something that triggers me. Constructing a form cost
time.
I think that is not true when you compare that with painting a form.

The constructing will normaly be a fraction from the painting in every
system.

That to let you think in another way before you create a memory consuming
solution on your pocket PC.

Cor

Nov 16 '05 #5
JW,

When I look at your problem than I think that I would try to use a public
event on my forms and show and hide them according to that.

(They are all constructed of course so it will cost resources in my opinion)

Just an idea

Cor
Nov 16 '05 #6
JW,

When I look at your problem than I think that I would try to use a public
event on my forms and show and hide them according to that.

(They are all constructed of course so it will cost resources in my opinion)

Just an idea

Cor
Nov 16 '05 #7
JW
Dear NG,

I have solved the problem (for the moment?) by getting rid of the array loop
and passing control between each form in the sequence somewhat like a linked
list. In this way I can display each form as modeless, whilst retaining the
main thread of execution with the currently visible form.

James.

"JW" <ne**@nospam.wollaston.com> wrote in message
news:42**********************@news.optusnet.com.au ...
Dear NG,

Still working on my .NET CF C# forms application ...

I have an array of forms that I wish to display in array order, and thus
have created a loop to run through them. Due to functional and speed
reasons (this app. will be deployed to a PocketPC) I want to merely Hide()
each form when the user is finished with it, rather than allow it to
Close(). In this way the user can "back" button their way back to each
previous form which has retained its state (functional), and each form is
only created once rather than a constant create/destroy demand on the
(small) processor (speed).

Problem: if I call ShowDialog() on each form I have to call Close() for each form to return control to the array so that the next form can be displayed. If I only call Show() the resulting form is not modal and so the array loop goes on its merry way displaying the next (and the next, and the next etc.) form.

At this point I am assuming that the solution will involve creating a new
thread in which to display each form, whilst the main thread waits to be
notified that it can continue? (because this is maybe how I would approach
the problem in Java?)

Is there some way to achieve this that I am missing or do I have to thread
my way out of this one?

Many TIAs,

James.

Nov 16 '05 #8
JW
Dear NG,

I have solved the problem (for the moment?) by getting rid of the array loop
and passing control between each form in the sequence somewhat like a linked
list. In this way I can display each form as modeless, whilst retaining the
main thread of execution with the currently visible form.

James.

"JW" <ne**@nospam.wollaston.com> wrote in message
news:42**********************@news.optusnet.com.au ...
Dear NG,

Still working on my .NET CF C# forms application ...

I have an array of forms that I wish to display in array order, and thus
have created a loop to run through them. Due to functional and speed
reasons (this app. will be deployed to a PocketPC) I want to merely Hide()
each form when the user is finished with it, rather than allow it to
Close(). In this way the user can "back" button their way back to each
previous form which has retained its state (functional), and each form is
only created once rather than a constant create/destroy demand on the
(small) processor (speed).

Problem: if I call ShowDialog() on each form I have to call Close() for each form to return control to the array so that the next form can be displayed. If I only call Show() the resulting form is not modal and so the array loop goes on its merry way displaying the next (and the next, and the next etc.) form.

At this point I am assuming that the solution will involve creating a new
thread in which to display each form, whilst the main thread waits to be
notified that it can continue? (because this is maybe how I would approach
the problem in Java?)

Is there some way to achieve this that I am missing or do I have to thread
my way out of this one?

Many TIAs,

James.

Nov 16 '05 #9
"JW" <ne**@nospam.wollaston.com> wrote in message
news:42***********************@news.optusnet.com.a u...
Cor,

Many thanks for your reply.

Even if I factor in your comments about the cost of construction versus
the
cost of repainting, isn't the cost of repainting incurred regardless of
whether or not I construct new forms all the time or reuse existing ones?
That is, any new form needs to be painted (made visible) for the first
time
anyway?

James.

Yes, but I think the point is that if the time it takes to construct is, say
1/10 the time it takes to paint, which it has to do anyway, the user will
not notice the difference (most people can't tell the difference between .5
seconds and .55 seconds.) Also, these systems are limited in memory, and on
most computers, general performance slows down if you overload the memory. I
think the only way to really know if it's noticeably faster one way or the
other is to do testing both ways (under whatever is a normal load for that
machine.)

Of course, it may be that an application does something time-consuming when
it loads before the paint. Like, say, establishing a wireless network
connection. That might well take more time than either the rest of
construction or painting, and would be worthwhile to do once outside of
creating the forms if the memory used by keeping the entire form around was
an issue.
Nov 16 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Matt K. | last post by:
Hi there, I have a form in an Access project that contains a subform which displays the results of a query of the style "select * from where = #a certain date#". In the main part of the form...
1
by: Jon Pope | last post by:
I've got an MDI Parent which hosts several child forms. When the application closes (either through a File|Exit call or by clicking on the "X" in the upper right corner), I check to see if any of...
0
by: JW | last post by:
Dear NG, Still working on my .NET CF C# forms application ... I have an array of forms that I wish to display in array order, and thus have created a loop to run through them. Due to...
20
by: Peter Oliphant | last post by:
How does one launch multiple forms in an application? Using Photoshop as an example, this application seems to be composed of many 'disjoint' forms. Yet, they all seem somewhat 'active' in...
7
by: Terry | last post by:
I have a Mainform with a Statusbar. When opening another form or doing some processing I want to display info in the Statusbar of the Mainform. I have read a lot of articles on this & have come up...
10
by: morangolds | last post by:
Hi, I've been having a problem with C++ Windows Forms apps not "ending" when you close the form window. I've searched about this problem all over the place and most searches have lead me to...
2
by: MORALBAROMETER | last post by:
Hallo, I want to write a programming with c#.Net having forms like MS Word. The main form A contain commonly used objects.I have many other forms (B,C,D) etc that have inherited from A. i realised...
13
by: Academic | last post by:
I have a MDI form, sometimes child forms and sometimes forms that are neither If I close the app the child forms closing and closed event happens followed by the Mdi form receiving the...
14
by: =?Utf-8?B?UHVjY2E=?= | last post by:
Hi, I'm using VS2005 and .net 2.0. I'm creating an application that has 3 forms. I want allow users to move forward and backward with the forms and retain the data users have entered. I thought...
2
by: =?Utf-8?B?RXRoYW4gU3RyYXVzcw==?= | last post by:
I am (still) relatively new to Windows applications, most of my experience has been Web based, and I am confused about what exactly happens when the Main() method is called and how to manipulate...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.