X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fd7ab28c5e655d496d1765143eab0b649cb54a4e..644231539d2ccf9ef873060154079f33ba7a42db:/src/msw/listbox.cpp?ds=sidebyside diff --git a/src/msw/listbox.cpp b/src/msw/listbox.cpp index 6d1f05a556..e6103c2025 100644 --- a/src/msw/listbox.cpp +++ b/src/msw/listbox.cpp @@ -516,12 +516,15 @@ wxListBox::DoInsertItems(const wxArrayString& items, int pos) int idx = ListBox_InsertString(GetHwnd(), i + pos, items[i]); #if wxUSE_OWNER_DRAWN - wxOwnerDrawn *pNewItem = CreateItem(idx); - pNewItem->SetName(items[i]); - pNewItem->SetFont(GetFont()); - m_aItems.Insert(pNewItem, idx); + if ( m_windowStyle & wxLB_OWNERDRAW ) + { + wxOwnerDrawn *pNewItem = CreateItem(idx); + pNewItem->SetName(items[i]); + pNewItem->SetFont(GetFont()); + m_aItems.Insert(pNewItem, idx); - ListBox_SetItemData(GetHwnd(), idx, pNewItem); + ListBox_SetItemData(GetHwnd(), idx, pNewItem); + } #endif // wxUSE_OWNER_DRAWN }