4/02/2012

(TIP) ListBox contents count limit to prevent memory overflow and to show the latest list

(TIP) ListBox contents count limit to prevent memory overflow and to show the latest list

int nCount = m_ListBox1.GetCount();
//Contents count limit
if(nCount > 1000)
     m_ListBox1.ResetContent();

//To view the last content
if ( nCount > 0 )
     m_ListBox1.SetCurSel( nCount-1 );

No comments:

Post a Comment