diff --git a/include/wx/htmllbox.h b/include/wx/htmllbox.h
index 97f2ae413e..666717632b 100644
--- a/include/wx/htmllbox.h
+++ b/include/wx/htmllbox.h
@@ -61,9 +61,9 @@ public:
// destructor cleans up whatever resources we use
virtual ~wxHtmlListBox();
- // refresh everything
+ // override some base class virtuals
virtual void RefreshAll();
-
+ virtual void SetItemCount(size_t count);
protected:
// this method must be implemented in the derived class and should return
diff --git a/include/wx/vlbox.h b/include/wx/vlbox.h
index 5e09100e7f..276076ece7 100644
--- a/include/wx/vlbox.h
+++ b/include/wx/vlbox.h
@@ -130,7 +130,7 @@ public:
// set the number of items to be shown in the control
//
// this is just a synonym for wxVScrolledWindow::SetLineCount()
- void SetItemCount(size_t count);
+ virtual void SetItemCount(size_t count);
// delete all items from the control
void Clear() { SetItemCount(0); }
diff --git a/src/generic/htmllbox.cpp b/src/generic/htmllbox.cpp
index a9d2f468c3..dff147a45c 100644
--- a/src/generic/htmllbox.cpp
+++ b/src/generic/htmllbox.cpp
@@ -262,6 +262,14 @@ void wxHtmlListBox::RefreshAll()
wxVListBox::RefreshAll();
}
+void wxHtmlListBox::SetItemCount(size_t count)
+{
+ // the items are going to change, forget the old ones
+ m_cache->Clear();
+
+ wxVListBox::SetItemCount(count);
+}
+
// ----------------------------------------------------------------------------
// wxHtmlListBox implementation of wxVListBox pure virtuals
// ----------------------------------------------------------------------------