473,503 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

repainting the form or create another form?

rs
I wonder, performance wise, if it is better to have one form and repaint the
components on that form or to have mutiple forms and show and dispose them?

Thanks
Nov 21 '05 #1
6 1139
I think it depends on the kind of the app u are constructing and also depends
on its size. Have in mind the inheritance that could be useful and try yo
organize your code in modules, etc; many smallsize files (like java classes).

Hope i made myself clear.

Nov 21 '05 #2
"rs" <aa@d.com> schrieb:
I wonder, performance wise, if it is better to have one form and repaint
the components on that form or to have mutiple forms and show and dispose
them?


User experience is most important. So, if it's impossible to separate
things without confusing the user or making him/her less productive, keep
everything on one form, otherwise split up the form into multiple
forms/dialogs.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Nov 21 '05 #3
rs
sorry guys, I forgot to mention few things:

I am building a MDI application with treelist at the left side and a tool
bar at the top.

in the middle area the application shows one form at a time. What I wanted
to know, if it is better to have one form and add the components to the form
using code or create for example 6 forms and dispose and show them within
the main form

Thanks

Ahmed
"VladimirHorowitz" <Vl**************@discussions.microsoft.com> wrote in
message news:BD**********************************@microsof t.com...
I think it depends on the kind of the app u are constructing and also
depends
on its size. Have in mind the inheritance that could be useful and try yo
organize your code in modules, etc; many smallsize files (like java
classes).

Hope i made myself clear.

Nov 21 '05 #4
rs,
In addition to the other comments.

I would create multiple forms, show & dispose them, simply as that normally
would be the greatest chance of leveraging encapsulation. Remember
encapsulation is one of the tenants of OO. If there is common logic I would
consider a base form & inheriting from that, again encapsulation &
inheritance. Remember that inheritance is another tenant of OO.

Performance wise: I would apply the 80/20 rule & more IMHO more importantly
consider user perception of performance!
Remember that most programs follow the 80/20 rule (link below) that is 80%
of the execution time of your program is spent in 20% of your code. I will
optimize the 20% once that 20% has been identified & proven to be a
performance problem via profiling (see CLR Profiler in my other message).

For info on the 80/20 rule & optimizing only the 20% see Martin Fowler's
article "Yet Another Optimization Article" at
http://martinfowler.com/ieeeSoftware...timization.pdf

Hope this helps
Jay
"rs" <aa@d.com> wrote in message news:wp********************@rogers.com...
I wonder, performance wise, if it is better to have one form and repaint
the components on that form or to have mutiple forms and show and dispose
them?

Thanks

Nov 21 '05 #5
rs,
Same answer.

6 forms, show & dispose them. (again encapsulation).

Depending on the nature of the forms, you can consider hiding rather then
disposing...

Again if the 6 forms have common logic I would consider inheritance.
I am building a MDI application with treelist at the left side and a tool
bar at the top. Are you thinking a real *Multiple* Document Interface (MDI) app, or are you
thinking more along the lines of "Tools - Options" in VS.NET? Where when you
select a node in the tree & the "page" displays different controls? Where
there is only a single "page" displayed at a time.

For an VS.NET "Tools - Options" type app I would consider using 6
UserControls instead of 6 form. Where each UserControl encapsulates the
logic for 1 specific "page". I would either show & hide or create & dispose
of the UserControls, or possibly consider a delayed create & hide...

Hope this helps
Jay

"rs" <aa@d.com> wrote in message news:Bb********************@rogers.com... sorry guys, I forgot to mention few things:

I am building a MDI application with treelist at the left side and a tool
bar at the top.

in the middle area the application shows one form at a time. What I wanted
to know, if it is better to have one form and add the components to the
form using code or create for example 6 forms and dispose and show them
within the main form

Thanks

Ahmed
"VladimirHorowitz" <Vl**************@discussions.microsoft.com> wrote in
message news:BD**********************************@microsof t.com...
I think it depends on the kind of the app u are constructing and also
depends
on its size. Have in mind the inheritance that could be useful and try yo
organize your code in modules, etc; many smallsize files (like java
classes).

Hope i made myself clear.


Nov 21 '05 #6
rs

"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message
news:eJ**************@TK2MSFTNGP15.phx.gbl...
rs,
Same answer.

6 forms, show & dispose them. (again encapsulation).

Depending on the nature of the forms, you can consider hiding rather then
disposing...

Again if the 6 forms have common logic I would consider inheritance.
I am building a MDI application with treelist at the left side and a tool
bar at the top. Are you thinking a real *Multiple* Document Interface (MDI) app, or are
you thinking more along the lines of "Tools - Options" in VS.NET? Where
when you select a node in the tree & the "page" displays different
controls? Where there is only a single "page" displayed at a time.

For an VS.NET "Tools - Options" type app I would consider using 6
UserControls instead of 6 form. Where each UserControl encapsulates the
logic for 1 specific "page". I would either show & hide or create &
dispose of the UserControls, or possibly consider a delayed create &
hide...


That exactly what I am trying to do. Thats why I was hesitant in creating
more than one form. It seems the 6 controls then is what i am looking for.

thanks Jay and everyone. I really appreciated.
Ahmed
Hope this helps
Jay

"rs" <aa@d.com> wrote in message news:Bb********************@rogers.com...
sorry guys, I forgot to mention few things:

I am building a MDI application with treelist at the left side and a tool
bar at the top.

in the middle area the application shows one form at a time. What I
wanted to know, if it is better to have one form and add the components
to the form using code or create for example 6 forms and dispose and show
them within the main form

Thanks

Ahmed
"VladimirHorowitz" <Vl**************@discussions.microsoft.com> wrote in
message news:BD**********************************@microsof t.com...
I think it depends on the kind of the app u are constructing and also
depends
on its size. Have in mind the inheritance that could be useful and try
yo
organize your code in modules, etc; many smallsize files (like java
classes).

Hope i made myself clear.



Nov 21 '05 #7

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

Similar topics

2
2373
by: Hal Vaughan | last post by:
I have a "wizard" type program with a series of panels that are placed in a JPanel. When the "Next >" button is pressed, I put in a new panel (in other words, the ActionListener for "Next >"...
0
977
by: Phil | last post by:
I have a .net/C# com object that creates a thread and a window to output results obtained in the thread (the thread is reading a com port). Everything seems to be working correctly (I don't get any...
0
1272
by: Mike Richardson | last post by:
Hello, I am using VB.net. Is there a way to stop the screen from repainting. I would perfer to stop screen repainting for the entire application. Example when a form is loading. Stop...
2
2167
by: Phil | last post by:
I have a .net/C# com object that creates a thread and a window to output results obtained in the thread (the thread is reading a com port). Everything seems to be working correctly (I don't get any...
4
2478
by: Alan Lambert | last post by:
Hi, I'm making various changes to the controls on a form and the form flickers as images are loaded etc. Is there a way to stop the form showing the updates until they have been completed? e.g....
2
2066
by: Geraldine Hobley | last post by:
Hello, In my application I am trying to load up some forms, however the loading of the forms is causing a lot of flickering. Are there any commands that can stop showing the repainting of the forms...
5
1420
by: Jesse Aufiero | last post by:
Hello all, I have many buttons on a form and at the bottom of the form is a grid that behaves as though it is 'retractable' - at various times during the life of the app, the grid becomes taller...
6
4312
by: Scott | last post by:
I have a unbound MS graph object built as a pie chart that I set to a value list and I am updating programatically. Everything works except that the graph does not repaint except for when the...
2
2111
by: vunet.us | last post by:
Please, explain an interesting phenomenon, if you can. I have an array of references to an HTML element: <div id='container'> <div id='someId1'></div> <div id='someId2'></div> </div> ........
0
7188
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
7063
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
7258
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,...
1
6970
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7441
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
4663
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3156
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3146
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1489
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.