PC Review


Reply
Thread Tools Rate Thread

best SDI methods

 
 
R.A.F.
Guest
Posts: n/a
 
      19th Nov 2007
Hi,

I would like to have your advice regarding a simple SDI application.
i have 3 forms : FMain, FMainHW and FMainSW.
when my application run FMain display the main menu and interface of the
SDI application.
in this menu i have 2 items HW and SW.

when i click on HW item, it should display FMainHW form into the SDI
application.
when i click on SW item, it should display FMainSW form into this SDI
application.

for that i use the following code :

private void MenuSW_Click(object sender, EventArgs e)
{
TSContainer.ContentPanel.Controls.Clear();
if (this.fmSW != null)
{
fmSW.Parent = TSContainer.ContentPanel;
fmSW.Show();
}
else
{
fmSW = new FMainSW();
fmSW.TopLevel = false;
fmSW.Parent = TSContainer.ContentPanel;
fmSW.Show();
}
}

a similar code is used for HW item.

however, i guess it is not the best method because the memory usage
starts at 19.490 Kb and at each click (switching between the 2 menu
items) it increases a little bit.

so, what is the best way to display in my SDI form other forms without
increasing memory usage.
fmSW and fmHW are private data members of my FMain form class.

thanks a lot,
RAF
 
Reply With Quote
 
 
 
 
Nicholas Paldino [.NET/C# MVP]
Guest
Posts: n/a
 
      19th Nov 2007
RAF,

If I had to guess, you are looking at the task manager to determine your
memory usage. This is not the amount of memory that you are using, but
rather, the working set, which is a completely different thing.

If you want to get a true indication of how much memory is being used,
you need to look at the performance counters for .NET.

You should look there first to see what your actual memory usage is, and
then see if it is outside of your expectations.


--
- Nicholas Paldino [.NET/C# MVP]
- (E-Mail Removed)

"R.A.F." <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
>
> I would like to have your advice regarding a simple SDI application.
> i have 3 forms : FMain, FMainHW and FMainSW.
> when my application run FMain display the main menu and interface of the
> SDI application.
> in this menu i have 2 items HW and SW.
>
> when i click on HW item, it should display FMainHW form into the SDI
> application.
> when i click on SW item, it should display FMainSW form into this SDI
> application.
>
> for that i use the following code :
>
> private void MenuSW_Click(object sender, EventArgs e)
> {
> TSContainer.ContentPanel.Controls.Clear();
> if (this.fmSW != null)
> {
> fmSW.Parent = TSContainer.ContentPanel;
> fmSW.Show();
> }
> else
> {
> fmSW = new FMainSW();
> fmSW.TopLevel = false;
> fmSW.Parent = TSContainer.ContentPanel;
> fmSW.Show();
> }
> }
>
> a similar code is used for HW item.
>
> however, i guess it is not the best method because the memory usage starts
> at 19.490 Kb and at each click (switching between the 2 menu items) it
> increases a little bit.
>
> so, what is the best way to display in my SDI form other forms without
> increasing memory usage.
> fmSW and fmHW are private data members of my FMain form class.
>
> thanks a lot,
> RAF



 
Reply With Quote
 
R.A.F.
Guest
Posts: n/a
 
      19th Nov 2007
But do you think the method i used to display forms in SDI application,
is correct ?

Nicholas Paldino [.NET/C# MVP] wrote:
> RAF,
>
> If I had to guess, you are looking at the task manager to determine your
> memory usage. This is not the amount of memory that you are using, but
> rather, the working set, which is a completely different thing.
>
> If you want to get a true indication of how much memory is being used,
> you need to look at the performance counters for .NET.
>
> You should look there first to see what your actual memory usage is, and
> then see if it is outside of your expectations.
>
>

 
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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Create my own asynchronous BeginXXXX methods and EndXXXX methods Varangian Microsoft C# .NET 2 15th May 2008 09:46 PM
plse send troubleshooting methods about windows xp and windowsserver2003 about configuring user rights and security methods to implement touser lakshmikanthkkp456@gmail.com DIY PC 1 11th Apr 2008 09:58 AM
Is it possible to make generalized methods that accept parameterized references to call other methods? Microsoft C# .NET 3 22nd Jun 2007 11:19 PM
proper way to pass pointers by reference from managed c++ methods to native c++ methods Scott McFadden Microsoft VC .NET 1 22nd Apr 2006 06:10 AM
what's better Static Methods or Instace Methods David Microsoft Dot NET Framework 12 22nd Sep 2004 05:42 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:15 AM.