+void MyFrame::OnSetItemsCount(wxCommandEvent& WXUNUSED(event))
+{
+ int numItems = wxGetNumberFromUser
+ (
+ "Enter the initial number of items for "
+ "the list and report views",
+ "Number of items:",
+ "wxWidgets wxListCtrl sample",
+ m_numListItems,
+ 0,
+ 10000,
+ this
+ );
+ if ( numItems == -1 || numItems == m_numListItems )
+ return;
+
+ m_numListItems = numItems;
+
+ if ( m_listCtrl->HasFlag(wxLC_REPORT) &&
+ !m_listCtrl->HasFlag(wxLC_VIRTUAL) )
+ RecreateList(wxLC_REPORT);
+ else if ( m_listCtrl->HasFlag(wxLC_LIST) )
+ RecreateList(wxLC_LIST);
+}
+