oPropertyDescriptorCollection.Item("Visible").SetValue(selectedControl,
Thanks & regards.
"Mital" <nospam@hotmail.com> wrote in message
news:%23035XfCVFHA.3184@TK2MSFTNGP15.phx.gbl...
> Hi,
>
> Thanks for reply. I have added context menu to the designer as "Implements
> IMenuCommandService.ShowContextMenu". It means when user right click on
> the control, it will show specific context menu based on control
> selection.
>
> Based on click event of context menu I have done as follow inside class
> MenuCommandService Implements IMenuCommandService:
>
> Private sub mnuVisible_Click()
> Dim selectionService As ISelectionService =
> CType(Me._host.GetService(GetType(ISelectionService)), ISelectionService)
> Dim selectedComponent As System.ComponentModel.Component =
> CType(selectionService.PrimarySelection, System.ComponentModel.Component)
> selectedControl.Visible = False '''<= This makes control invisible.
> End Sub
>
> I did not raised ComponentChanged event. Also, can you please provide code
> snippet, how to set visible property using TypeDescriptor inside
> MenuCommandService class?
>
> Thanks again for your help.
>
> Kind Regards.
> Mital
>
> "news.microsoft.com" <noreply@softwarefx.com> wrote in message
> news:%23gwxOsqUFHA.3944@tk2msftngp13.phx.gbl...
>> How are you setting the Visible property in your code ? Have you tried
>> raising ComponentChanging/ComponentChanged (IComponentChangeService) ?
>>
>> Using TypeDescriptor to set the property is equivalent.
>>
>> Are you overriding the Visible property ? Are you calling base.Visible ?
>>
>> --
>> Francisco Padron
>>
www.chartfx.com >> "Mital" <nospam@hotmail.com> wrote in message
>> news:%23GBNhtdUFHA.3716@TK2MSFTNGP12.phx.gbl...
>>> Hi,
>>>
>>> I am creating my own designer using
>>>
http://www.divil.co.uk/net/articles/designers/hosting.asp (Also reading
>>> through open source #Develop project.)
>>>
>>> I can change Visible property of the control using propertygrid without
>>> any problem, but if I change Visible property value to false using code,
>>> control is hidden on the screen, and square control selection is apprer
>>> only.
>>>
>>> How do I change property visible = false into propertgrid, but control
>>> is still visible on the screen like visual studio does.
>>>
>>> Kind Regards.
>>>
>>> Mital
>>>
>>>
>>>
>>
>>
>
>