diff --git a/src/msw/checklst.cpp b/src/msw/checklst.cpp index f9790875b9..7c928d371b 100644 --- a/src/msw/checklst.cpp +++ b/src/msw/checklst.cpp @@ -322,14 +322,8 @@ bool wxCheckListBox::Create(wxWindow *parent, wxWindowID id, long style, const wxValidator& validator, const wxString& name) { - if (wxListBox::Create(parent, id, pos, size, n, choices, - style | wxLB_OWNERDRAW, validator, name)) - { - SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)); - return true; - } - else - return false; + return wxListBox::Create(parent, id, pos, size, n, choices, + style | wxLB_OWNERDRAW, validator, name); } bool wxCheckListBox::Create(wxWindow *parent, wxWindowID id, @@ -338,14 +332,8 @@ bool wxCheckListBox::Create(wxWindow *parent, wxWindowID id, long style, const wxValidator& validator, const wxString& name) { - if (wxListBox::Create(parent, id, pos, size, choices, - style | wxLB_OWNERDRAW, validator, name)) - { - SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)); - return true; - } - else - return false; + return wxListBox::Create(parent, id, pos, size, choices, + style | wxLB_OWNERDRAW, validator, name); } // misc overloaded methods diff --git a/src/msw/listbox.cpp b/src/msw/listbox.cpp index c799cf3479..ffe24da141 100644 --- a/src/msw/listbox.cpp +++ b/src/msw/listbox.cpp @@ -174,6 +174,10 @@ bool wxListBox::Create(wxWindow *parent, return false; } + // Necessary to prevent scroll problems within a notebook with Windows + // effects enabled + SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)); + // initialize the contents for ( int i = 0; i < n; i++ ) {