[RESOLVED] conditional hiding ocx property in property browser

Hi,
I am working on an activex control. I want to hide some properties of ocx , if certain properties are set.

e.g.

The control has a Multiline and a MaxLines property. I want to hide the MaxLines property, if the Multiline property is set to False, and display it if Multiline property is set to True.

Is it possible? If yes then how?
Thanks
[377 byte] By [jawadSahil] at [2007-11-20 10:23:07]
# 1 Re: [RESOLVED] conditional hiding ocx property in property browser
Are you talking about hiding the properties in the VB IDE? To my knowledge it is impossible to do this.
PeejAvery at 2007-11-9 19:35:00 >
# 2 Re: [RESOLVED] conditional hiding ocx property in property browser
You can hide a property via the Tools|Procedure Attributes IDE menu. However, that doesn't truly hide them since a VB user can actually opt to view hidden attributes. Now, I don't think it is possible, on the fly, to toggle whether a property is hidden or not. If it is possible it would require advanced coding and use of Type Libraries, Windows Implementations of the OLE interfaces, and a bunch more code that will probably cause you more pain than gain.

I think a suitable response when trying to set a property that "shouldn't" be set is to return the generic "Invalid Property Value" or something similar. These types of warning are useful since the code is run in IDE many times before compiled, and the user will learn that what they just did is a no-no.
LaVolpe at 2007-11-9 19:36:00 >
# 3 Re: [RESOLVED] conditional hiding ocx property in property browser
Thanks PeejAvery and LaVolpe,

I just wanted to know whether there is an easy way to conditionally hide the properties in the property browser.

I was not sure whether it can be done...

Otherwise my control is working fine :)

Thanks again for response.
jawadSahil at 2007-11-9 19:37:02 >