-
November 24th, 2009, 09:13 AM
#1
Collection Editor -> Remove Button Event
Hello,
I have some problems with the Collection Editor. I have to do some synchronizations after removing an item from the collection but can;t figure out which function I have to override.
For the "add" button works everything fine with this function:
Code:
public class myEditor : CollectionEditor
{
protected override object CreateInstance(Type itemType)
{
if (!form.IsDisposed && form.ShowDialog() == DialogResult.OK)
{
// [... do some stuff here ..]
}
else
{
return null;
}
}
}
Now I'm searching for the function of the remove button.
Thanks in advance!
-
July 5th, 2011, 04:20 PM
#2
Re: Collection Editor -> Remove Button Event
I use a different approach. I hook an event to the Remove Button as bellow:
protected override CollectionForm CreateCollectionForm()
{
if (frmCollectionEditorForm.Controls[0] is TableLayoutPanel)
{
TableLayoutPanel tlp = frmCollectionEditorForm.Controls[0] as TableLayoutPanel;
if (tlp.Controls[1] is TableLayoutPanel)
{
TableLayoutPanel tlp2 = tlp.Controls[1] as TableLayoutPanel;
if (tlp2.Controls[1] is Button)
(tlp2.Controls[1] as Button).Click += Remove_Click;
}
}
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|