Jump to content
Xtreme .Net Talk

Weird virtual methods of the ListBox don't seem to do anything at all.


Recommended Posts

Posted (edited)

My MB (custom messageBox) never shows!

protected override void AddItemsCore(object[] o)
{
a.MB.ShowDialog(o.GetType());
if(o.GetType() == typeof(FileLBItem))
        this.Items.Add(o);
return;
}

protected override void SetItemsCore(IList o)
{
a.MB.ShowDialog(o.GetType());
if(o.GetType() == typeof(FileLBItem))
	this.Items.Add(o);
return;
}

protected override void SetItemCore(int i, object o)
{
a.MB.ShowDialog(o.GetType());
if(o.GetType() == typeof(FileLBItem))
	this.Items.Add(o);
return;
}

I am trying to check if the Item that is added to the listbox is of a certain type before I add it.

 

But none of these methods do anything at all. I know I didn't call the base methods in the code above but I do have it in my code here at home.

 

Is there any way to check the items BEFORE they are added to the ListBox?

Edited by aewarnick
C#

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...