disappearing controls

R

Rachel Suddeth

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
 
P

Peter Bromberg [C# MVP]

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
 
R

Rachel Suddeth

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:[email protected]]
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 said:
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.
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top