473,788 Members | 2,744 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 1159
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
"VladimirHorowi tz" <Vl************ **@discussions. microsoft.com> wrote in
message news:BD******** *************** ***********@mic rosoft.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******** ************@ro gers.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******** ************@ro gers.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
"VladimirHorowi tz" <Vl************ **@discussions. microsoft.com> wrote in
message news:BD******** *************** ***********@mic rosoft.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******** ******@TK2MSFTN GP15.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******** ************@ro gers.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
"VladimirHorowi tz" <Vl************ **@discussions. microsoft.com> wrote in
message news:BD******** *************** ***********@mic rosoft.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
2385
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 >" selects the proper panel from a CardLayout). Some of these panels, when selected, perform actions immediately. When that happens, the panel is not displayed until the action is complete. I've tried invalidating the layout and repainting, but it...
0
1006
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 errors), but no results are displayed in the window. If I move the window it is not repainting itself, so I am sure that that is the problem, but I don't know how to fix it. Can someone give me a point in the right direction? Thanks, Phil
0
1306
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 repainting. Execute code. restore repainting. In VB 6 I called
2
2187
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 errors), but no results are displayed in the window. If I move the window it is not repainting itself, so I am sure that that is the problem, but I don't know how to fix it. Can someone give me a point in the right direction? Thanks, Phil
4
2489
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. Form.Painting = False I'm sure this is very easy but I can't seem to find a way of doing it! Many thanks Alan
2
2094
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 and thus make for a smoother running application. mdiClient.DkManager.LoadConfigFromFile("c:\alpine\aims\QuoteHistoryconfig.xml") mdiClient.ActiveForm.Controls.Add(mdiClient._filler) 'Controls.SetChildIndex(_filler, 0)...
5
1431
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 and conceals the many buttons below it. That transition is fine. The problem is that when the grid retracts back down to the bottom portion of the form, to reveal the many buttons underneath it, the repainting is slow and ugly.
6
4326
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 entire subroutine is completed. I launch the sub from a command button on the same tab as the graph object. I have tired to force a requery of the msgraph, a refresh of the form and even a repaint of the form. I have put in waits and msgboxs to...
2
2136
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> ..... myArray = document.getElementById("someId1"); myArray = document.getElementById("someId2");
0
10373
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10177
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8995
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7519
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5403
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5538
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4074
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 we have to send another system
2
3677
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2897
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.