By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,882 Members | 2,453 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,882 IT Pros & Developers. It's quick & easy.

disappearing controls

P: n/a
Here is my scenario:
I have a few custom controls that I set up on a form and tested setting
properties and appearances.
Then I added a couple references to the project which add classes I need to
get data from the server to actually do something useful. (These are
generated by 3rd party database software.)

After adding those references, and no other changes to my form.... all the
controls disappear from the visual interface on the form. In the code...
declarations are still there
(eg:
private Bloodhound.BHTabControl bhTabControl1;

private System.Windows.Forms.TabPage tabPage1;

private Bloodhound.BHStringTextBox txtCode;

private Bloodhound.BHTextBox txtDesc;

private Bloodhound.BHButton btnTest;)

But ALL the code dealing with these (like creating instances and adding them
to the form) is GONE from the InitializeComponent() method.

----

I can not see why adding a couple references should change this, but I
compiled and ran the thing before adding those references... OH... I guess I
did a definition that needed the references and it didn't compile...

private exist_recordsDataTable tblRecids = new exist_recordsDataTable();

This needed types defined in a reference I hadn't added. So I tried to
recompile, and it failed. I added the references and it compiled, but wiped
out a bunch of other code I had. Why would it do that?

I have had designer-set properties (such as label text and locations)
disappear mysteriously before...
I added designer code to the properties I exposed of the nature
[DefaultValue(x)], and that seemed to take care of the problem until now.
Maybe this is a bug in the 3rd party stuff... but what causes this sort of
thing to happen in C# and are there procedures I can do to prevent it, or
something I can tell 3rd party developers to look at?
__________________________________________________ ____________
Roydan Enterprises Ltd
602 North 9th Street
Manitowoc, WI 54220-3924
1-800-236-6906 (920)-684-3688
Fax: (920)-684-3630
Nov 16 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
I have seen this happen with Visual Inheritance when attempting to change
something on the base class. One workaround is to save the form, then CLOSE
the form in the IDE, and build.
When forms are reopened in the IDE everything should stay. In rare cases,
it may even be necessary to close VS.NET and then open it again and reload
the solution.
HTH
--Peter

"Rachel Suddeth" <ra****@bldhound.com> wrote in message
news:#2**************@TK2MSFTNGP10.phx.gbl...
Here is my scenario:
I have a few custom controls that I set up on a form and tested setting
properties and appearances.
Then I added a couple references to the project which add classes I need to get data from the server to actually do something useful. (These are
generated by 3rd party database software.)

After adding those references, and no other changes to my form.... all the
controls disappear from the visual interface on the form. In the code...
declarations are still there
(eg:
private Bloodhound.BHTabControl bhTabControl1;

private System.Windows.Forms.TabPage tabPage1;

private Bloodhound.BHStringTextBox txtCode;

private Bloodhound.BHTextBox txtDesc;

private Bloodhound.BHButton btnTest;)

But ALL the code dealing with these (like creating instances and adding them to the form) is GONE from the InitializeComponent() method.

----

I can not see why adding a couple references should change this, but I
compiled and ran the thing before adding those references... OH... I guess I did a definition that needed the references and it didn't compile...

private exist_recordsDataTable tblRecids = new exist_recordsDataTable();

This needed types defined in a reference I hadn't added. So I tried to
recompile, and it failed. I added the references and it compiled, but wiped out a bunch of other code I had. Why would it do that?

I have had designer-set properties (such as label text and locations)
disappear mysteriously before...
I added designer code to the properties I exposed of the nature
[DefaultValue(x)], and that seemed to take care of the problem until now.
Maybe this is a bug in the 3rd party stuff... but what causes this sort of
thing to happen in C# and are there procedures I can do to prevent it, or
something I can tell 3rd party developers to look at?
__________________________________________________ ____________
Roydan Enterprises Ltd
602 North 9th Street
Manitowoc, WI 54220-3924
1-800-236-6906 (920)-684-3688
Fax: (920)-684-3630

Nov 16 '05 #2

P: n/a
Oops.

Thanks again, Peter. I had a book that said "Visual Inheritance" is the same
as form inheritance, but this makes a lot more sense to me. At least that it
would include anything that has a "design surface" you can look at in VS. So
far it is working to close the test project before compiling changes to the
base, so I will add that into the document of procedures for adding changes
to these classes.

-Rachel

----- Original Message -----
From: "Peter Bromberg"
To: "'Rachel Suddeth (Bloodhound Software)'"
Sent: Monday, August 23, 2004 10:40 AM
Subject: RE: disappearing controls

Rachel,
When you reply to a newsgroup post, it is customary to reply to the group,
not to the poster via email.
My use of the term "Visual Inheritance" meant deriving anything from
something else that has a UI, in order to inherit and / or
override the UI.
Peter

-----Original Message-----
From: Rachel Suddeth (Bloodhound Software) [mailto:ra****@bldhound.com]
Sent: Monday, August 23, 2004 10:16 AM
To: Peter Bromberg [C# MVP]
Subject: Re: disappearing controls

Thanks - I'll give that a try & if it works we'll at least know the
procedure. Could be an argument for using a separate solution for the base
controls & forms... that would help to enforce closing forms while working
on base items.

By "Visual Inheritance" do you mean using an inherited form? Or does that
apply to inherited control as well (using the "Add Inherited Control" from
the "project" menu...) Just not sure about the terminology. We are using an inherited form & I'm trying to remember whether I saw any of that stuff
before I started testing with that (started with the controls on a standard form first.)

Thanks,
Rachel

----- Original Message -----
From: "Peter Bromberg [C# MVP]"
Newsgroups: microsoft.public.dotnet.languages.csharp
Sent: Saturday, August 21, 2004 8:17 AM
Subject: Re: disappearing controls

I have seen this happen with Visual Inheritance when attempting to change
something on the base class. One workaround is to save the form, then CLOSE
the form in the IDE, and build.
When forms are reopened in the IDE everything should stay. In rare cases, it may even be necessary to close VS.NET and then open it again and reload the solution.
HTH
--Peter

"Rachel Suddeth" <ra****@bldhound.com> wrote in message
news:#2**************@TK2MSFTNGP10.phx.gbl...
Here is my scenario:
I have a few custom controls that I set up on a form and tested setting properties and appearances.
Then I added a couple references to the project which add classes I need
to
get data from the server to actually do something useful. (These are
generated by 3rd party database software.)

After adding those references, and no other changes to my form.... all the controls disappear from the visual interface on the form. In the
code... declarations are still there
(eg:
private Bloodhound.BHTabControl bhTabControl1;

private System.Windows.Forms.TabPage tabPage1;

private Bloodhound.BHStringTextBox txtCode;

private Bloodhound.BHTextBox txtDesc;

private Bloodhound.BHButton btnTest;)

But ALL the code dealing with these (like creating instances and adding them
to the form) is GONE from the InitializeComponent() method.

----

I can not see why adding a couple references should change this, but I
compiled and ran the thing before adding those references... OH... I

guess
I
did a definition that needed the references and it didn't compile...

private exist_recordsDataTable tblRecids = new

exist_recordsDataTable();
This needed types defined in a reference I hadn't added. So I tried to
recompile, and it failed. I added the references and it compiled, but

wiped
out a bunch of other code I had. Why would it do that?

I have had designer-set properties (such as label text and locations)
disappear mysteriously before...
I added designer code to the properties I exposed of the nature
[DefaultValue(x)], and that seemed to take care of the problem until

now. Maybe this is a bug in the 3rd party stuff... but what causes this
sort of thing to happen in C# and are there procedures I can do to prevent it, or something I can tell 3rd party developers to look at?
__________________________________________________ ____________
Roydan Enterprises Ltd
602 North 9th Street
Manitowoc, WI 54220-3924

Nov 16 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.