473,387 Members | 1,771 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,387 software developers and data experts.

What has happened to my controls?

Hi, I am using VS2005. I have a form with a tabControl on it. Suddenly I can
no longer see any of my controls, on any of the pages, or even the
tabControl itself. They still exist because the various objects are
available in the properties interface. If I select one I can see all the
properties but the control doesn't show in the design area.
When I run the application the form appears blank. Here are the properties
on the tabControl that I would consider relevant (evidently I am missing
something):
Enabled True
ItemSize 420, 180
Location 0,0
MaximumSize 600, 800
Size 471, 800
Visible True

My conclusion would be that something has gone wrong in Form1.Designer.cs
but I haven't touched it (I swear I never did). The code inside
InitializeComponent() looks ok.

Any ideas would be appreciated.
Jun 27 '08 #1
5 1428
On 27/05/2008 in message <OM**************@TK2MSFTNGP03.phx.gblPaul
Hemans wrote:
>My conclusion would be that something has gone wrong in Form1.Designer.cs
but I haven't touched it (I swear I never did). The code inside
InitializeComponent() looks ok.
This happened to me with VS2005 and the Tab Control - closing and
re-opening VS usually fixed it. I haven't seen it in VS2008 (yet!).

--
Jeff Gaines
Damerham Hampshire UK
Jun 27 '08 #2
Had my first VS2008 Winforms designer disaster the other day. It just
started complaining that the .resx file for one of my forms was corrupt.
Looking at the error you could see a bunch of text in nice columns up until
the problem point where there were five lines of complete garbage. The
program would then not compile.

Luckily I didn't have much in there and copying the .cs and the .Designer.cs
into a new form solved it.

--

BlackWasp
www.blackwasp.co.uk
"Jeff Gaines" <wh*********@newsgroups.nospamwrote in message
news:xn****************@msnews.microsoft.com...
On 27/05/2008 in message <OM**************@TK2MSFTNGP03.phx.gblPaul
Hemans wrote:
>>My conclusion would be that something has gone wrong in Form1.Designer.cs
but I haven't touched it (I swear I never did). The code inside
InitializeComponent() looks ok.

This happened to me with VS2005 and the Tab Control - closing and
re-opening VS usually fixed it. I haven't seen it in VS2008 (yet!).

--
Jeff Gaines
Damerham Hampshire UK
Jun 27 '08 #3
On Tue, 27 May 2008 17:58:54 +1000, Paul Hemans wrote:
Hi, I am using VS2005. I have a form with a tabControl on it. Suddenly I can
no longer see any of my controls, on any of the pages, or even the
tabControl itself. They still exist because the various objects are
available in the properties interface. If I select one I can see all the
properties but the control doesn't show in the design area.
When I run the application the form appears blank. Here are the properties
on the tabControl that I would consider relevant (evidently I am missing
something):
Enabled True
ItemSize 420, 180
Location 0,0
MaximumSize 600, 800
Size 471, 800
Visible True

My conclusion would be that something has gone wrong in Form1.Designer.cs
but I haven't touched it (I swear I never did). The code inside
InitializeComponent() looks ok.

Any ideas would be appreciated.
Hi
Delete your obj directory and rebuild. It's VS's scratch pad. Have you
noticed that intellisense is also playing up?
Mark
Jun 27 '08 #4
Hi Mark,
I deleted the properties and the obj directories and it didn't help.
Am I correct in assuming that nothing I have done within my code (Form1.cs)
should affect Form1.Designer.cs? The fact that the objects appear in the
properties window suggests that the form designer is reading the
initializeComponent() method. It is just the layout that is malfunctioning.

In case it helps, this is the code in the initializeComponent() from
Form1.Designer.cs...
private void InitializeComponent()

{

this.StatusLabel = new System.Windows.Forms.Label();

this.chkLogging = new System.Windows.Forms.CheckBox();

this.tabControl = new System.Windows.Forms.TabControl();

this.controlPage = new System.Windows.Forms.TabPage();

this.StopButton = new System.Windows.Forms.Button();

this.StartButton = new System.Windows.Forms.Button();

this.dbPage = new System.Windows.Forms.TabPage();

this.checkLogging = new System.Windows.Forms.CheckBox();

this.label1 = new System.Windows.Forms.Label();

this.listenPort = new System.Windows.Forms.TextBox();

this.submitButton = new System.Windows.Forms.Button();

this.reloadButton = new System.Windows.Forms.Button();

this.dataGridView = new System.Windows.Forms.DataGridView();

this.serviceController = new System.ServiceProcess.ServiceController();

this.tabControl.SuspendLayout();

this.controlPage.SuspendLayout();

this.dbPage.SuspendLayout();

((System.ComponentModel.ISupportInitialize)(this.d ataGridView)).BeginInit();

this.SuspendLayout();

//

// StatusLabel

//

this.StatusLabel.AutoSize = true;

this.StatusLabel.Location = new System.Drawing.Point(30, 17);

this.StatusLabel.Name = "StatusLabel";

this.StatusLabel.Size = new System.Drawing.Size(73, 13);

this.StatusLabel.TabIndex = 3;

this.StatusLabel.Text = "IP address is :";

//

// chkLogging

//

this.chkLogging.AutoSize = true;

this.chkLogging.Location = new System.Drawing.Point(17, 13);

this.chkLogging.Name = "chkLogging";

this.chkLogging.Size = new System.Drawing.Size(68, 17);

this.chkLogging.TabIndex = 4;

this.chkLogging.Text = "Log data";

this.chkLogging.UseVisualStyleBackColor = true;

//

// tabControl

//

this.tabControl.Controls.Add(this.controlPage);

this.tabControl.Controls.Add(this.dbPage);

this.tabControl.Location = new System.Drawing.Point(12, 12);

this.tabControl.Name = "tabControl";

this.tabControl.SelectedIndex = 0;

this.tabControl.Size = new System.Drawing.Size(471, 510);

this.tabControl.TabIndex = 5;

//

// controlPage

//

this.controlPage.Controls.Add(this.StopButton);

this.controlPage.Controls.Add(this.StartButton);

this.controlPage.Controls.Add(this.StatusLabel);

this.controlPage.Location = new System.Drawing.Point(4, 22);

this.controlPage.Name = "controlPage";

this.controlPage.Padding = new System.Windows.Forms.Padding(3);

this.controlPage.Size = new System.Drawing.Size(463, 484);

this.controlPage.TabIndex = 0;

this.controlPage.Text = "Status";

this.controlPage.UseVisualStyleBackColor = true;

//

// StopButton

//

this.StopButton.Location = new System.Drawing.Point(301, 66);

this.StopButton.Name = "StopButton";

this.StopButton.Size = new System.Drawing.Size(75, 23);

this.StopButton.TabIndex = 5;

this.StopButton.Text = "Stop";

this.StopButton.UseVisualStyleBackColor = true;

//

// StartButton

//

this.StartButton.Location = new System.Drawing.Point(33, 62);

this.StartButton.Name = "StartButton";

this.StartButton.Size = new System.Drawing.Size(75, 23);

this.StartButton.TabIndex = 4;

this.StartButton.Text = "Start";

this.StartButton.UseVisualStyleBackColor = true;

//

// dbPage

//

this.dbPage.Controls.Add(this.checkLogging);

this.dbPage.Controls.Add(this.label1);

this.dbPage.Controls.Add(this.listenPort);

this.dbPage.Controls.Add(this.submitButton);

this.dbPage.Controls.Add(this.reloadButton);

this.dbPage.Controls.Add(this.dataGridView);

this.dbPage.Controls.Add(this.chkLogging);

this.dbPage.Location = new System.Drawing.Point(4, 22);

this.dbPage.Name = "dbPage";

this.dbPage.Padding = new System.Windows.Forms.Padding(3);

this.dbPage.Size = new System.Drawing.Size(463, 484);

this.dbPage.TabIndex = 1;

this.dbPage.Text = "Connections";

this.dbPage.UseVisualStyleBackColor = true;

//

// checkLogging

//

this.checkLogging.AutoSize = true;

this.checkLogging.Font = new System.Drawing.Font("Microsoft Sans Serif",
8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point,
((byte)(0)));

this.checkLogging.Location = new System.Drawing.Point(228, 56);

this.checkLogging.Name = "checkLogging";

this.checkLogging.Size = new System.Drawing.Size(71, 17);

this.checkLogging.TabIndex = 11;

this.checkLogging.Text = "Logging";

this.checkLogging.UseVisualStyleBackColor = true;

//

// label1

//

this.label1.AutoSize = true;

this.label1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F,
System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point,
((byte)(0)));

this.label1.Location = new System.Drawing.Point(18, 55);

this.label1.Name = "label1";

this.label1.Size = new System.Drawing.Size(42, 13);

this.label1.TabIndex = 9;

this.label1.Text = "Port #";

//

// listenPort

//

this.listenPort.Location = new System.Drawing.Point(69, 52);

this.listenPort.Name = "listenPort";

this.listenPort.Size = new System.Drawing.Size(46, 20);

this.listenPort.TabIndex = 8;

//

// submitButton

//

this.submitButton.Location = new System.Drawing.Point(363, 13);

this.submitButton.Name = "submitButton";

this.submitButton.Size = new System.Drawing.Size(75, 23);

this.submitButton.TabIndex = 7;

this.submitButton.Text = "Submit";

this.submitButton.UseVisualStyleBackColor = true;

//

// reloadButton

//

this.reloadButton.Location = new System.Drawing.Point(17, 11);

this.reloadButton.Name = "reloadButton";

this.reloadButton.Size = new System.Drawing.Size(75, 23);

this.reloadButton.TabIndex = 6;

this.reloadButton.Text = "Reload";

this.reloadButton.UseVisualStyleBackColor = true;

//

// dataGridView

//

this.dataGridView.ColumnHeadersHeightSizeMode =
System.Windows.Forms.DataGridViewColumnHeadersHeig htSizeMode.AutoSize;

this.dataGridView.Location = new System.Drawing.Point(6, 106);

this.dataGridView.Name = "dataGridView";

this.dataGridView.Size = new System.Drawing.Size(451, 372);

this.dataGridView.TabIndex = 5;

//

// serviceController

//

this.serviceController.ServiceName = "SAFserverService";

//

// statusForm

//

this.ClientSize = new System.Drawing.Size(292, 266);

this.Name = "statusForm";

this.Load += new System.EventHandler(this.statusForm_Load_1);

this.tabControl.ResumeLayout(false);

this.controlPage.ResumeLayout(false);

this.controlPage.PerformLayout();

this.dbPage.ResumeLayout(false);

this.dbPage.PerformLayout();

((System.ComponentModel.ISupportInitialize)(this.d ataGridView)).EndInit();

this.ResumeLayout(false);

}

#endregion

private System.Windows.Forms.Label StatusLabel;

private System.Windows.Forms.CheckBox chkLogging;

private System.Windows.Forms.TabControl tabControl;

private System.Windows.Forms.TabPage controlPage;

private System.Windows.Forms.TabPage dbPage;

private System.Windows.Forms.Button submitButton;

private System.Windows.Forms.Button reloadButton;

private System.Windows.Forms.Button StopButton;

private System.Windows.Forms.Button StartButton;

private System.ServiceProcess.ServiceController serviceController;

private System.Windows.Forms.Label label1;

private System.Windows.Forms.TextBox listenPort;

private System.Windows.Forms.CheckBox checkLogging;

}
Jun 27 '08 #5
Well, for some reason the line of code:
this.Controls.Add(this.tabControl);
was missing from InitializeComponent().
The way I figured it out was to copy the project, then add another
tabControl to the form and then look at designer.cs for whatever changes had
been made. What caused this line to disappear? I don't know, but anyway
learnt a few things along the way to figuring it out.
Jun 27 '08 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

125
by: Sarah Tanembaum | last post by:
Beside its an opensource and supported by community, what's the fundamental differences between PostgreSQL and those high-price commercial database (and some are bloated such as Oracle) from...
3
by: Michael | last post by:
I just spent two hours trying to work out why my procedure wouldn't allow me to set the focus to a control in a subform. The control is in a tab control in the subform My code looked like this ...
6
by: SugarDaddy | last post by:
I'm pretty new to C#, but I've had a lot of experience with MFC. MFC had a mechanism for updating dialog controls using an idle message. For those unfamiliar, basically you would override OnIdle...
1
by: JS | last post by:
Hello, I am using ASP .Net to create my own web controls and I have noticed that there is one too many requirements that forces the developer to be aware of and get involved with. In the past...
9
by: Jay | last post by:
Everywhere I go (read/browse) I see these parameters.... ByVal sender As Object, ByVal e As System.EventArgs Yet I never see them used within the function/method. Could someone tell me what they...
7
by: Mike Hillmann | last post by:
I am creating a form with a boatload of radiobuttons on it. In VB6 I used to create a control array with the index property and have only 1 procedure to worry about to handle the click events. ...
1
by: Steve Richter | last post by:
a simple web page that adds controls to a Panel control at run time. Problem is, on PostBack, all the controls I added to the Panel are missing! ViewState is enabled on the panel. What happened to...
11
by: active | last post by:
If I install .NET Framework 3.0 what will happen to my VS2005 experience? Will it automatically use 3.0? Will I find new features available? Will the VS doc be updated? Thanks fir any...
3
by: Giampaolo Rodola' | last post by:
http://groups.google.com/group/python-dev2 It seems it no longer exists. What happened?
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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...

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.