473,403 Members | 2,183 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,403 software developers and data experts.

Loading control of a form before Form_load event

Hi,
I am working on asp.net 2.0 windows application.I have a form which consist near about 80 diffrent controls and i am creating all this control at the runtime .When this form loads then all controls are loading one by one,but i want to load all that control before form get display..how can i do this.means I have to load these controls before Form load,

Thanks
Rohit vyas
Sep 12 '07 #1
8 1388
Plater
7,872 Expert 4TB
Give your form a public function of the likes:
Expand|Select|Wrap|Line Numbers
  1. public void AddControll(Control c)
  2. {
  3.    this.Controls.Add(c);
  4. }
  5.  
Then you can create all your controls and then create an instance of your form.
Then use that function there to add all the controls to your form.
Then use the .Show() function to display your form.
Sep 12 '07 #2
Give your form a public function of the likes:
Expand|Select|Wrap|Line Numbers
  1. public void AddControll(Control c)
  2. {
  3.    this.Controls.Add(c);
  4. }
  5.  
Then you can create all your controls and then create an instance of your form.
Then use that function there to add all the controls to your form.
Then use the .Show() function to display your form.
===========
I have add controls in InitializeComponent() which is call from constructor.So when the forms load..constructor is called and all the controls are created and added to form,but when the form is rendered,all controls are loaded one by one due to which performance of application is slow ,plz suggest me some idea to achive it
Sep 12 '07 #3
Plater
7,872 Expert 4TB
How many controls did you say you have? The more controls you have the longer it will take. Its the nature of the beast.
Try and cut back on them somewhat or look to load some and then add more as they are needed.

Our run on a faster computer?
Sep 12 '07 #4
How many controls did you say you have? The more controls you have the longer it will take. Its the nature of the beast.
Try and cut back on them somewhat or look to load some and then add more as they are needed.

Our run on a faster computer?
I have near about 70-75 controls on my page and all controls are necessary...can i use threading concept in this case if yes then how can i do this by threading...


Thanks for your reply
Sep 12 '07 #5
Plater
7,872 Expert 4TB
The GUI already runs in another thread.
I don't know what you're using that causes such a lag? I've never found a need for maybe a couple of dozen controls to be visible at one time though
Sep 12 '07 #6
The GUI already runs in another thread.
I don't know what you're using that causes such a lag? I've never found a need for maybe a couple of dozen controls to be visible at one time though
Actually when my form is loaded it flickering,and i want flickring free painting of controls on the form...i think now u may be getting what is my problem
Sep 13 '07 #7
Plater
7,872 Expert 4TB
Maybe try turning on the double-buffering thing?

And check:
http://msdn.microsoft.com/msdnmag/is...e/default.aspx
Sep 13 '07 #8
Maybe try turning on the double-buffering thing?

And check:
http://msdn.microsoft.com/msdnmag/is...e/default.aspx
I have already turning on the double-buffering as well as ,i have done manual double buffering in my code after that i got the flickering effect on my form when it loads...
Sep 14 '07 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: VM | last post by:
How can I manually run the code of an event? For example, I want to run a Mouse click event without actually clicking doing a Mouse click? Thanks.
3
by: markeboy | last post by:
I am wanting to control when a page is loaded using a separate class to manage when and how it should be loade My current implementation needs to set a property of the page programatically...
0
by: Andy Fish | last post by:
Hi, I have a web user control that has a textbox on it. In the form_load event of the owning form, I dynamically add the web user control to the page. The Load event of the control fires OK,...
4
by: C M Shaw | last post by:
I have a form which I want to show modally; it's a fairly old form that's been ported up several versions of VB, and I'd like to keep its rewriting to a minimum. Basically, it is used in this...
2
by: Manuel | last post by:
When a form loads it fires all modification events for its controls. For example, if I put a comboBox and give it some values at design time, it will fire the comboBox_Change event (or whatever it...
2
by: thomasp | last post by:
Using VB 2005 Beta. I have a form containing a DataGirdView. The cell enter, cell validating, row enter, row validating events have a good bit of code that gets excuted for each of these...
4
by: Rich | last post by:
Hello, I have 3 textboxes and 1 combobox on a form. On entering the control I want to select all the text. I can make an array of textboxes like this: Dim arrTxt As TextBox() = {txt1, txt2,...
13
by: PW | last post by:
Hi, This is bizarre. I've check and rechecked the spelling, cut and paste the name of the form (when trying to rename the form) and the control yet I still get a parameter prompt when the form...
3
by: Hamed | last post by:
Hello I have a Data Entry Form having some controls including a TextBox. When the user types an entry, I query a table and if it was entered before, I ask the user (using ShowModal method of a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: 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
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
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...
0
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
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...

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.