Hiding null properties of a component

S

Sujith Manuel

Hi All,

I have one component developed in C#. It has got three properties and only
one of them will be having value at design time. This means that values of
other two properties will be null.

Whenever I drag & drop this component into a form, VS.NET is giving a
warning as :

" The object 'MyComponent1' returned null for the property 'Property1' but
this is not allowed."

Is it possible to hide some properties a component based on it's value; or
is there ay way to avoid this problem.

Thanks in advance,
Sujith Manuel.
 
E

Erik Frey

Sujith Manuel said:
Hi All,

I have one component developed in C#. It has got three properties and only
one of them will be having value at design time. This means that values of
other two properties will be null.

Whenever I drag & drop this component into a form, VS.NET is giving a
warning as :

" The object 'MyComponent1' returned null for the property 'Property1' but
this is not allowed."

Is it possible to hide some properties a component based on it's value; or
is there ay way to avoid this problem.

Thanks in advance,
Sujith Manuel.

I'm not sure if this answers your question, but you should investigate the
BrowsableAttribute class:

http://msdn.microsoft.com/library/d...omponentmodelbrowsableattributeclasstopic.asp

Erik
 

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