
Signature
Francisco Padron
www.chartfx.com
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
> How are you setting the Visible property in your code ? Have you tried
> raising ComponentChanging/ComponentChanged (IComponentChangeService) ?
[quoted text clipped - 20 lines]
>>
>> Mital
Mital - 09 May 2005 01:17 GMT
Hi,
I have implemented TypeDescriptor as follow, which updates Visible property:
Dim oPropertyDescriptorCollection As
System.ComponentModel.PropertyDescriptorCollection =
System.ComponentModel.TypeDescriptor.GetProperties(selectedControl, True)
If Not oPropertyDescriptorCollection.Item("Visible") Is Nothing Then
oPropertyDescriptorCollection.Item("Visible").SetValue(selectedControl,
False)
End If
I hope this is right way to implement Visible property as you specified.
Thanks & regards.
Mital
> Hi,
>
[quoted text clipped - 47 lines]
>>>
>>> Mital
Francisco Padron - 11 May 2005 20:01 GMT
That is exactly what I meant.
Did it work ?

Signature
Francisco Padron
www.chartfx.com