Hello again.
I was wondering if any of you have experienced the following behavior. I
wrote a custom type editor and a custom collection editor. Both work as
expected. The problem lies with the collection editor.
If I launch the collection editor via the property grid, the editor comes
up. It can add, remove, etc... everything works well. When I click 'Ok' in
the collection editor, the property grid reflects that the collection was
appropriately changed. However, the forms designer doesn't modify the
generated code to reflect the changes *until* I do something else on the
form that modifies the code (i.e.- move a control or resize it). If I do
this, the next time I inspect the code, it has been modified with the
changes that were made in the property grid and the custom designers.
So... how, after a property change or an addition to a collection, do I
tell Windows forms to rethink its code?
Thanks- Dan I
stax - 07 Mar 2005 01:29 GMT
Hi,
try something like this:
Dim ccs As IComponentChangeService = _
Type(GetService(GetType(IComponentChangeService)), _
IComponentChangeService)
ccs.OnComponentChanged(Me, Nothing, Nothing, Nothing)
Regards,
stax
Dan i - 07 Mar 2005 19:54 GMT
joeycalisay - 07 Mar 2005 04:40 GMT
you just have to notify the designer through the IComponentChangeService by
Raising the appropriate events. You'll get a reference of the
ITypeDescriptorContext from the EditValue method, you just have to call its
OnComponentChanging and OnComponentChanged methods appropriately.

Signature
Joey Calisay
http://spaces.msn.com/members/joeycalisay/
> Hello again.
>
[quoted text clipped - 15 lines]
>
> Thanks- Dan I
Dan I - 07 Mar 2005 19:55 GMT