Questions tagged [initializecomponent]
61 questions
1
vote
2 answers
vb.net InitializeComponent() is not declared
I want to use InitializeComponent() when I create a custom control (to be sure everthing is initialized before I use it), but the compiler says it's not declared. But my Designer.vb contains a sub:
Private…

MaBi
- 1,372
- 3
- 13
- 19
1
vote
1 answer
InitializeComponent does not exist in the current context, using Mono C# compiler
I am using mcs version 2.10.8.1 in Ubuntu 12.04, I have the following code:
using System;
using System.Drawing;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
…

user1535776
- 599
- 2
- 5
- 10
1
vote
2 answers
Initialize Component Error C#
So I was all done with my program and tried to edit a few small things at the top, and started getting errors and can't change them back. Here is the code:
namespace FinalProject
{
public partial class Form : Form
{
public Form();
…

Boneyards
- 83
- 1
- 2
- 9
0
votes
1 answer
Form's resx file contains Point/Size and other weird UI objects
For some reason one of our forms reads all UI element data from its corresponding resx file. We want all data to be explicitly assigned in the code instead.
E.g. Our resx file contains the location of our forms buttons:
Name:…

l33t
- 18,692
- 16
- 103
- 180
0
votes
1 answer
VS2010 Winform designer alterate decent code
I'm encountering a problem with the WinForm designer. I made a new UserControl, I added a DataGridView, some other elements and a TreeView. With the gui I named all those new components. Now it's time to code that stuff and I realise that the…

Francis Gagnon
- 59
- 1
- 8
0
votes
1 answer
When implementing C# Maui XAML popup what can cause error 'InitializeComponent does not exist' or 'Popup could not be found' and what is resolution?
When implementing a C# Maui XAML popup, there are a few types of problems and\or mistakes that can occur which cause it to fail.
The most common error messages appear to be the following:
The name 'InitializeComponent' does not exist in the current…

Todd Albers
- 71
- 3
0
votes
0 answers
Why does wpf report a NullReferenceException at "System.Windows.ContextLayoutManager.From"?
在 System.Windows.ContextLayoutManager.From(Dispatcher dispatcher)
在 System.Windows.UIElement.InvalidateMeasure()
在 System.Windows.Controls.Decorator.set_Child(UIElement value)
在…
0
votes
1 answer
Handle event or something just before code for Control.ResumeLayout is executed
I have a System.Windows.Forms.UserControl which performs a this.ResumeLayout(false) at the end of the method InitializeComponent.
I would like to know if there is any way or event to handle just before the code for the ResumeLayout is executed.
I…

Willy
- 9,848
- 22
- 141
- 284
0
votes
1 answer
InitializeComponent() Error Help
Im a beginner programmer for Visual Studio 2005 and coding in VB and i required some help.
I've been hitting this error everytime i call InitializeComponent() :
ComException was unhandled
Class not registered (Exception from HRESULT : 0x80040154…

Steven Tang
- 1
- 1
0
votes
1 answer
Xamarin Forms Tabbed Page Tabs Initializing
I am developing a tabbed Page in Xamarin that consist of 3 tabs ( Tab1= "Home" , Tab2= "Chat" ,Tab3="Menu" )
When the App starts ( MainPage = new TabbedPage() ) it initializes (InitializeComponent();) all the tabs together at first.
My question is…

Amjad S.
- 1,196
- 1
- 4
- 16
0
votes
2 answers
How to prevent Design View from using default constructor?
Situation: I am making a Collapsible Panel. In my business situation, I am required to have the panel support the following:
A "direction" (ie, will it dock top, bottom, left, or right). This changes which direction it collapses and a few other…

Alexander Bird
- 38,679
- 42
- 124
- 159
0
votes
1 answer
C# Application crashes on startup at InitializeComponent(), throws CultureNotFoundException
My Windows Forms Application installs and works without problems on Windows 10 (latest version). However, when installed on Windows 2012R2 x64 Terminal server, the program crashes on startup.
The event log (please see below) seems to direct to the…

IceMan60088
- 1
- 1
0
votes
0 answers
StackOverflowException - Without Recursion
I am posting this question because the existing forum references to StackOverflowException, while informative, aren't exactly relevant to the current scenario that I am encountering.
I have been developing an application for my employer that I…
0
votes
0 answers
I keep getting an InitializeComponent(); error in my code
using System.Drawing;
using System.Windows.Forms;
using PaddleClass;
namespace Form1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
this.Paint += Form1_Paint;
this.Invalidate(); ///…

Patrick Marshall
- 23
- 4
0
votes
2 answers
How can I catch and elegantly handle exception where database is unavailable in WPF
I am trying to catch the exception when the Database is unavailable in WPF with EF. I am using MVVM and Repo pattern with IUnityContainer in C#.
My problem is that if the database is unavailable the program crashes on InitializeComponent() statement…

Tony
- 89
- 1
- 12