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?
IntializeComponent keeps getting overwritten
316 Views Asked by Alec Sanger At
1
There are 1 best solutions below
Related Questions in VB.NET
- If...Then...Else Visual Basic 2012
- Detecting whether a mouse button is down in vb.net
- IOrderedEnumerable to vb.net IOrderedEnumerable Conversion
- vb.net Get PrivateMemorySize64 and process id sort by memory size
- Cannot insert values into database
- check validation of an expression with Regex
- VB.NET KeyNotFoundException from String()
- How do i display data that are in between 2 values in a DDL?
- VB.net: How to make original variable value fulfill 2 statements?
- Login form by using a new database, made in VB
- Get Text from listbox in VB.net
- error handing for uploading large size file
- XML Null Element Visual Basic
- Using chart and tooltip
- vb2010 Express - Operator '=' is not defined
Related Questions in VISUAL-STUDIO-2010
- How would I be able to use a file in visual studio project on any computer?
- Which is the most advantageous strategy for creating a tweaked Visual Studio Project Template?
- ASP.NET textbox textchange with same text input
- windows phone emulator of visual studio 2010
- Reference to an object magically disaprears? STRANGE
- Implementing a custom header bar for chromiumembedded
- Aldebaran Nao robot simulator without a real robot
- windows form application to work with Oracle without installing Oracle client
- Referenced DLL is not found when running application from VS
- Records won't update in datagridview
- Writing to text file with StreamWriter. File used by another process
- Double templated function overload fails
- Make input to Web Service field optional not required
- How to update label from callback function in code behind?
- display .NET code error instead of HTTP 500
Related Questions in DESIGNER
- PHP designer 8 Syntax Highlighing
- sitecore pageeditor - On saving gets error as "please insert a destination page"
- How to open Designer View in Visual C#?
- HeaderTemplate Design-Data Crashes XAML Designer
- Visual Studio 2015 Universal Windows XAML designer surface loading forever
- Error while loading designer in wpf form
- Custom code in designer.vb file goes away when making edits in design mode
- Delete rows before doing any transformation in datastage designer?
- "Prefix '....' does not map to a namespace", A designer bug?
- How to refresh a WinForms Visual Studio Form design surface on-demand?
- Xaml designer doesn't show content of a usercontrol
- Integrate AngularJS App with SoftwareAG webMethods Integration Server
- Import model from Activiti modeler to Activiti designer
- Visual Studio 2013 - Fixing An Unhandled Exception has occured
- Adobe LiveCycle Designer ES4
Related Questions in INITIALIZECOMPONENT
- XAML child window subclass: "InitializeComponent shadows member in base class." How can I resolve this warning without modifying autogenerated code?
- c# Delete dialogresult
- Clean elegant solution to form-class level component collection initializing before Initialize Component?
- IntializeComponent keeps getting overwritten
- vb.net InitializeComponent() is not declared
- Application crashes in InitializeComponent()
- InitializeComponent equivalent for xaml
- Initialize Component Error C#
- C# Application crashes on startup at InitializeComponent(), throws CultureNotFoundException
- InitializeComponent() Cannot locate resource based on system language
- The type name does not exist in the type c# within InitializeComponent()
- Slow performance loading VBNET DLL
- Winforms appearance at 100%,125%,150% Windows scaling modes, and alleviating need to constantly edit Designer.cs class every time I update the GUI
- UWP Initialize components not recognised after clean System.Xaml could not be found
- InitializeComponent not defined after converting from Windows phone 8 silverlight to universal apps
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Yes,
InitializeComponentis completely IDE-generated; don't even try to mess with it.If you have conditional logic wherein you want to add/remove some controls, do it in your control's constructor after the auto-generated call to
InitializeComponent.Note that if the conditional stuff will depend on features enabled/disabled at design time (e.g., if someone else is using your control and you've provided properties to affect how that control behaves which you intend to be set at design time), using the constructor won't work since the constructor will have already run by the time the user makes his/her choices from the design view; in this case, override the
OnLoadmethod and put your logic in there (or do some variation of this, e.g., handle theLoadevent itself—there are plenty of ways to skin this cat).