CollectionEditor Remove button event?

L

lisa

I have a custom CollectionEditor. It's not very customized, and is
almost the same as any standard CollectionEditor.

A problem I have, which isn't really a problem, but is irksome, is that
when I go into the CollectionEditor and click on the Remove button, the
control in design mode doesn't update until I close the CollectionForm.

I figure this is wrong, because when I click on the Add button, it
*does* update. And as I said, it's not that big of a deal, because it
does update when I close the CollectionForm.

But I'd like to trap the button click event, so that I can at least see
what's going on. Maybe there *is* a problem, and I just haven't
noticed it yet.

I used the Reflector and found out that there's a private class called
CollectionEditorCollectionForm which has this method:

Private Sub RemoveButton_click(ByVal sender As Object, ByVal e As
EventArgs)

That's nice and all, but it doesn't seem to be accessible to me. I'd
have to create an entire CollectionForm from scratch, I think, and it
doesn't seem worth the effort.

Does anyone know how I can accomplish this?

Thanks,
Lisa
 
K

Ken Dopierala Jr.

Hi Lisa,

Don't know if this will help you because I always design my own forms for
modifying my controls in the IDE. If you can somehow be alerted when this
remove occurs then you can make the update happen like this:

Dim x As New YourDesigner
x.Initialize(Me (or reference to your control))
x.MarkChange()

This will cause the control to update in the design view. Since you can't
capture the button click is there an OnRemove event or anything else you can
tie into to run the code above? If not you may need to add some type of
event to your CollectionEditor that you can somehow capture to tell your
designer to go ahead and update the control. Good luck! Ken.
 
L

lisa

Hi Ken,

Thanks, but being alerts when the remove occurs is pretty much the same
thing as capturing the event. I think I'm going to have to delve more
deeply.

Lisa
 
K

Ken Dopierala Jr.

Hi Lisa,

When a remove occurs it should in some way update your collection. If your
collection is wrapped in a property then the Set on the property may be
called as soon as the remove button is clicked. In the Set you could run
your code. Ken.
 

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

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top