CCheckListBox not showing the full list at startup

  • Thread starter Thread starter Ante Meridian
  • Start date Start date
A

Ante Meridian

Guest
Greetings Everyone.

I'm using VS2017 and I have a problem with a CCheckListBox. I fill it with strings in the OnInitDialog function, but when the dialog appears, only the first few strings are shown. If I move the vertical scrollbar a small amount, the remaining strings suddenly appear.

1564184.png


1564185.png

Does anybody have any ideas what might be going on, or how to deal with it?

Here's the code from the OnInitDialog, in case that helps.

BOOL CCombiningEntityTypesDlg::OnInitDialog()
{
CDialog::OnInitDialog();

// Set the text to display the type of set that we are editing.
CString csText = "Select the Entity Types to include when combining ";
csText += m_csSetTypeToDisplay;
m_staticDisplayText.SetWindowText(csText);


System::Collections::Generic::List<System::String^> ^trussTypes = MiTek::EntityTypes::EntityTypeManager::GetInstance(MiTek::Infrastructure::Entity::DataContextBuilder::DefaultContext)->GetDefinedEntityTypeNames();


// Put the truss types into the list.
for each(System::String^ typeName in trussTypes)
{
CString csLongName = typeName;
m_clbEntityTypes.AddString(csLongName);
}

// The list is sorted, so we can't set the check marks as we insert them.
CString csType;
for(int i = 0; i < m_clbEntityTypes.GetCount(); i++)
{
m_clbEntityTypes.GetText(i, csType);
m_clbEntityTypes.SetCheck(i, IsIncluded(csType));
}



return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}

Continue reading...
 
Back
Top