473,509 Members | 2,857 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

MdiForm Design is gone!

What would cause VS2005 Pro to lose all of my MdiForm Design information?

I've been working on one of the Child Forms and having problems with the
Child Form's threads not completing (locking up and not responding anymore).

So, I shut down VS, turned off my PC, then turned everything back on.

Now, my MdiForm Design looks like a blank form whenever a new form is added
to a project. My Tray Icon, Status Bar strip, and Main Menu are all there,
but nothing is on the form.

What would cause Visual Studio to dump this? Is there a way that I can
salvage it? (probably not)
Aug 4 '08 #1
6 2263

"jp2msft" wrote:
What would cause VS2005 Pro to lose all of my MdiForm Design information?

I've been working on one of the Child Forms and having problems with the
Child Form's threads not completing (locking up and not responding anymore).

So, I shut down VS, turned off my PC, then turned everything back on.

Now, my MdiForm Design looks like a blank form whenever a new form is added
to a project. My Tray Icon, Status Bar strip, and Main Menu are all there,
but nothing is on the form.

What would cause Visual Studio to dump this? Is there a way that I can
salvage it? (probably not)
Hi,

What MdiForm design do you mean? As far as I know the VS designer wont
display child windows at design time, so how are you able to see them on the
MdiForm. Or do you mean UserControls? These can be dragged onto any form or
control and be displayed in the VS designer. However, an MdiForm also has a
MdiClient control added to it. If the MdiClient is somehow pushed topmost
(like MdiClient.BringToFront()) all other controls will appear to vanish as
they are put underneath.

If you are putting UserControls on your MdiParent and they vanish I'm
guessing the MdiClient is covering them. If so, try checking your code for a
MdiClient reference and make sure you aren't putting it in front of the
usercontrols.

--
Happy Coding!
Morten Wennevik [C# MVP]

Aug 5 '08 #2
"Morten Wennevik [C# MVP]" wrote:
>
"jp2msft" wrote:
What would cause VS2005 Pro to lose all of my MdiForm Design information?

I've been working on one of the Child Forms and having problems with the
Child Form's threads not completing (locking up and not responding anymore).

So, I shut down VS, turned off my PC, then turned everything back on.

Now, my MdiForm Design looks like a blank form whenever a new form is added
to a project. My Tray Icon, Status Bar strip, and Main Menu are all there,
but nothing is on the form.

What would cause Visual Studio to dump this? Is there a way that I can
salvage it? (probably not)

Hi,

What MdiForm design do you mean? As far as I know the VS designer wont
display child windows at design time, so how are you able to see them on the
MdiForm. Or do you mean UserControls? These can be dragged onto any form or
control and be displayed in the VS designer. However, an MdiForm also has a
MdiClient control added to it. If the MdiClient is somehow pushed topmost
(like MdiClient.BringToFront()) all other controls will appear to vanish as
they are put underneath.

If you are putting UserControls on your MdiParent and they vanish I'm
guessing the MdiClient is covering them. If so, try checking your code for a
MdiClient reference and make sure you aren't putting it in front of the
usercontrols.

--
Happy Coding!
Morten Wennevik [C# MVP]
Mr. Wennevik,

Actually, what has happened is that my MdiForm lost all of its settings. The
Main Menu, Status Bar, and Tray Icon controls still appear in Design Mode,
but the Main Form has lost all of its settings. The name is now "Form1"
(where it was my application's name), it is not set to be an MDI Form, there
is no Menu associated with the form (even though the Main Menu is still
located there), my application's icon is gone, ...everything has been reset!
You name it - it is no longer on my MDI form.
Aug 5 '08 #3
"jp2msft" wrote:
"Morten Wennevik [C# MVP]" wrote:

"jp2msft" wrote:
What would cause VS2005 Pro to lose all of my MdiForm Design information?
>
I've been working on one of the Child Forms and having problems with the
Child Form's threads not completing (locking up and not responding anymore).
>
So, I shut down VS, turned off my PC, then turned everything back on.
>
Now, my MdiForm Design looks like a blank form whenever a new form is added
to a project. My Tray Icon, Status Bar strip, and Main Menu are all there,
but nothing is on the form.
>
What would cause Visual Studio to dump this? Is there a way that I can
salvage it? (probably not)
Hi,

What MdiForm design do you mean? As far as I know the VS designer wont
display child windows at design time, so how are you able to see them on the
MdiForm. Or do you mean UserControls? These can be dragged onto any form or
control and be displayed in the VS designer. However, an MdiForm also has a
MdiClient control added to it. If the MdiClient is somehow pushed topmost
(like MdiClient.BringToFront()) all other controls will appear to vanish as
they are put underneath.

If you are putting UserControls on your MdiParent and they vanish I'm
guessing the MdiClient is covering them. If so, try checking your code for a
MdiClient reference and make sure you aren't putting it in front of the
usercontrols.

--
Happy Coding!
Morten Wennevik [C# MVP]

Mr. Wennevik,

Actually, what has happened is that my MdiForm lost all of its settings. The
Main Menu, Status Bar, and Tray Icon controls still appear in Design Mode,
but the Main Form has lost all of its settings. The name is now "Form1"
(where it was my application's name), it is not set to be an MDI Form, there
is no Menu associated with the form (even though the Main Menu is still
located there), my application's icon is gone, ...everything has been reset!
You name it - it is no longer on my MDI form.
Ah,

It sounds like Visual Studio in the chaos found the need to recreate the
form.designer.cs file and thereby managed to overwrite the original settings.
In that case, your old settings are probably gone unless you have some form
of source control. If you do have source control, replace the entire content
of <mdiform>.designer.cs with the older version. Also make sure you have a
call to InitializeComponent() in the constructor.

--
Happy Coding!
Morten Wennevik [C# MVP]

Aug 5 '08 #4
"Morten Wennevik [C# MVP]" wrote:
Ah,

It sounds like Visual Studio in the chaos found the need to recreate the
form.designer.cs file and thereby managed to overwrite the original settings.
In that case, your old settings are probably gone unless you have some form
of source control. If you do have source control, replace the entire content
of <mdiform>.designer.cs with the older version. Also make sure you have a
call to InitializeComponent() in the constructor.
I've got most of my fields added back onto the form by now. My problem now
is getting my Main Menu back!

Any idea how to do this?

I have specified that the Main Menu is the MdiForm's MainMenuStrip item, but
it does not actually appear on the form.

I don't suppose you would have any idea of how to do this?

I'd really rather not have to recreate my Main Menu, as I go through and
replace all of Visual Studio's very long names with something much simpler
(toolstripmenuitemFileOpen with miOpen), and that takes *hours* to do!
Aug 5 '08 #5
Ok, I found what I needed:

In the MdiForm's Designer.cs file, I added these items:

this.Controls.Add(this.MainMenu);
this.Controls.Add(this.StatusBar);
this.Controls.Add(this.TrayIcon);

However, the instructions say "do not modify the contents of this method
with the code editor."

Will my changes be lost? How do I ensure that these settings stay?

"jp2msft" wrote:
"Morten Wennevik [C# MVP]" wrote:
Ah,

It sounds like Visual Studio in the chaos found the need to recreate the
form.designer.cs file and thereby managed to overwrite the original settings.
In that case, your old settings are probably gone unless you have some form
of source control. If you do have source control, replace the entire content
of <mdiform>.designer.cs with the older version. Also make sure you have a
call to InitializeComponent() in the constructor.

I've got most of my fields added back onto the form by now. My problem now
is getting my Main Menu back!

Any idea how to do this?

I have specified that the Main Menu is the MdiForm's MainMenuStrip item, but
it does not actually appear on the form.

I don't suppose you would have any idea of how to do this?

I'd really rather not have to recreate my Main Menu, as I go through and
replace all of Visual Studio's very long names with something much simpler
(toolstripmenuitemFileOpen with miOpen), and that takes *hours* to do!
Aug 5 '08 #6

"jp2msft" wrote:
Ok, I found what I needed:

In the MdiForm's Designer.cs file, I added these items:

this.Controls.Add(this.MainMenu);
this.Controls.Add(this.StatusBar);
this.Controls.Add(this.TrayIcon);

However, the instructions say "do not modify the contents of this method
with the code editor."

Will my changes be lost? How do I ensure that these settings stay?

"jp2msft" wrote:
As long as you make sure you use the correct format when editing the
designer file you should be safe. The section is handled by Visual Studio
but editing it manually should update the designer as well. To add a control
to the designer section manually you need to add tre parts shown below.
After you add them go to the designer view and the control should pop up.
The safest way is to then cut away the control and paste it back. This will
let Visual Studio write the correct lines of code. Simpler things like
moving controls from one container to another, changing properties etc can be
done manually in the designer code just fine. You should, however, leave the
name property untouched in the designer file and change this in the designer
instead.

this.myControl = new MyControl();

....
///
/// myControl
///
this.myControl.Property1 = ...
....
....

private MyControl myControl;

--
Happy Coding!
Morten Wennevik [C# MVP]

Aug 6 '08 #7

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

Similar topics

2
1895
by: andreas | last post by:
I have a program with a mdiform and same childforms (with a textbox) that i open. All works fine. In the childform i open another form (for finding and replacing). In a sub in that form i try to...
0
222
by: andreas | last post by:
I have a program with a mdiform and same childforms (with a textbox) that i open. All works fine. In the childform i open another form (for finding and replacing). In a sub in that form i try to...
2
268
by: andreas | last post by:
I have a program with a mdiform and same childforms (with a textbox) that i open. All works fine. In the childform i open another form (for finding and replacing). In a sub in that form i try to...
0
315
by: andreas | last post by:
I have a program with a mdiform and same childforms (with a textbox) that i open. All works fine. In the childform i open another form (for finding and replacing). In a sub in that form i try to...
0
7234
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
7136
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
7344
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
7412
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...
1
7069
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
5652
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4730
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1570
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
775
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.