472,789 Members | 920 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,789 software developers and data experts.

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 2213

"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
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
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
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
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
by: Rina0 | last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

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.