What Does InitializeComponent Do
May 31, 2011
I'm converting a VB6 forms application to operate in VB2010. When initialising the form using VB2010 I've made use of the New() event with a call to InitializeComponent(), as suggested by the VB2010 Express debug facility. However, when InitializeComponent() is invoked I've noticed that the system runs the TextChanged events for some, but not all, of the components in the form.Can anyone explain what the InitializeComponent() call actually does? and why certain form events are executed whilst others are not?
View 2 Replies
Feb 7, 2011
I have some conditionals in my InitializeComponent which affect the layout based on some variables. Unfortunately, it seems like whenever I rebuild my application, this code is reverted back to its previous state. Is this code being regenerated based on the Designer interface? Is there a way to prevent it from doing this?
View 2 Replies
Feb 4, 2009
I am experiencing some trouble with the autogenerated initializecomponent function. Visual Studio insists on initializing a variable like the following, when I drag a usercontrol onto a form:
Dim HierarchyTreeNode1 As NewDelfiLib.HierarchyTreeNode = CType(New System.Windows.Forms.TreeNode(""), ND.HierarchyTreeNode)
View 1 Replies
Mar 26, 2009
I updated one reference in my project and all of the sudden, every time I run my app I get the following error:
Error Stack Trace
The details of where this error occurred are as follows:
Source: frmMyForm.designer.vb
[code].....
View 8 Replies
Apr 26, 2010
I need to add some code to the EndInit method of a PictureBox control but unfortunately its private and, from what I can gather, I can't shadow it and call base - at least not in VB.Net.What I can do is add a dummy property to my picture box class. The type of the dummy property is simply a class that just implements ISupportInitialize. However, that doesn't work, I need the dummy class to inherit from Control.Is that the minimum requirement?
View 1 Replies
Aug 28, 2010
I have a windows form and I created couple user controls, these UserControls are added on the form dynamically, everything works normally,
Just wondering where I should put the coding, should it be inside Form Load Event or after InitializeComponent() call?
View 5 Replies
Sep 20, 2011
Alright so i have a form with alot (ALOT) of controls...many tabs, many listviews, many comboboxes and textboxes, all of which have values which i saveload using a class i made for saving and loading these values from a file.
Loading these values is pretty slow after the form loads. Takes around 3 seconds (i had to create a splashscreen and made it look decent, but it's still not a nice thing to have)
Then today i decided to try something. I opened the designer to initialize component, and i called the LoaderSub (that loads the values for the controls from a file) within initialize component, in a location after all the properties are set but before all the .resumelayout and .performlayout are called. Lo' and behold the form loaded in less than half a second, with the values and all.
However, now everytime i make a change to the form in design view, or even add a handler to some control in code view, the designer redraws and the auto generated code takes out my code from initializecomponent.
I did the googling, and all the results i found for similar cases issues were cases where the person asking the question im going to ask, the answer is "Didn't you read the part that says DO NOT MODIFY?"
Still, as a last attempt, I ask here: is there any way to modify initializecomponent without losing my changes? I just need to call LoaderSub before the layout resumes...if i call it before initialize component, i get null reference exceptions. And if i call it right after initialize component, loading is very slow.
View 6 Replies
Jun 25, 2009
In C# Windows Forms, a user control's InitializeComponent is called from the form's/control's constructor. When I create same scenario in VB.NET I don't get a constructor, and I can't locate a place where InitializeComponent is called.I need to call my code between InitializeComponent and when the control's Load event is raised, preferably still in the control's constructor. How do I do this in VB.NET?
View 2 Replies
Aug 20, 2009
The code generator creates code with references to a component I am using, before it's dependent components (datasets) are initalized. Although I can correct this by editing the form.designer.vb file, everytime I make a change on the form the code is re-generated in the wrong order. Where does VS2008 store information about the order of the components for code generation.
This Runs:
'
'AppointmentBindingSource
'
Me.AppointmentBindingSource.DataMember = "appointment"
[Code].....
View 1 Replies
Sep 19, 2009
I have made changes to the windows form name from "form1" to "applicant_name" after that it shows this error The designer cannot process the code at line 249: Me.name = "applicant_name" The code within the method 'InitializeComponent' is generated by the designer and should not be manually modified. Please remove any changes and try opening the designer again.when i comment it its started working fine can any one suggest me wat to do and why it is comming
View 3 Replies
Jan 26, 2009
I add a mainmenu I have to edit InitializeComponent().I tried to take a shortcut and copy an existing menu and then rename it. Big mistake. If you have done it, do not do it again.Anyone have an idea of how to get me back on track? I have done a rebuild, closed VB etc.
'frmMain
Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 16.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font[code]....
View 3 Replies
Jan 25, 2011
To create splash screen before InitializeComponent, the WithEvents statement for the BackgroundWorker component needs to be moved from the Form's Designer.vb file into the constructor as indicated in the first commented lines of the constructor below.
[Code]...
View 19 Replies