Hello:
I have this code. Is theApplication.OpenForms to much overhead for the program?
((FormICEPack)Application.OpenForms["FormICEPack"]).textBoxLoginUser_ID.Text = textBoxUser_ID.Text;
((FormICEPack)Application.OpenForms["FormICEPack"]).textBoxLoginPassword.Text = textBoxPassword.Text;
((FormICEPack)Application.OpenForms["FormICEPack"]).textBoxLoginProfile_ID.Text = textBoxProfileLogin_ID.Text;
((FormICEPack)Application.OpenForms["FormICEPack"]).textBoxLoginProfileServer.Text = textBoxProfileServer.Text;
((FormICEPack)Application.OpenForms["FormICEPack"]).textBoxLoginProfileServerType.Text = textBoxProfileServerType.Text;
((FormICEPack)Application.OpenForms["FormICEPack"]).textBoxLoginProfileLogin_ID.Text = textBoxProfileLogin_ID.Text;
((FormICEPack)Application.OpenForms["FormICEPack"]).textBoxLoginProfilePassword.Text = textBoxProfilePassword.Text;
((FormICEPack)Application.OpenForms["FormICEPack"]).textBoxLoginProfileDatabase.Text = textBoxProfileDatabase.Text;
Loading

Nainil148 reputationPosted Mar 5, 2010, 10:30 AM EST
The more forms you open within a single application, the more memory your application is going to use. However from the above code it looks like you only have 1 instance of FormICEPack form opened and accessing that Form instance using the code above should not be too much overhead. Hope this helps.
Sam HobbsRank #107 · 20.5K reputationPosted Mar 5, 2010, 7:45 PM EST
GustavoRank #1,990 · 732 reputationPosted Mar 5, 2010, 10:17 PM EST
Thanks that is what I was looking for, the whole time:
This way I can define the form at load time and then use it any time I want.... Thanks.
theLizardRank #1,079 · 1.8K reputationPosted Mar 6, 2010, 10:43 AM EST
This is why I said that forms management is important in MDI applications so hope that you revisit the zip I uploaded for one of your questions.
theLizardRank #1,079 · 1.8K reputationPosted Mar 6, 2010, 10:44 AM EST
This is why I said that forms management is important in MDI applications so hope that you revisit the zip I uploaded for one of your questions.