+ WXDWORD msStyle = wxControl::MSWGetStyle(style, exstyle);
+
+ // always show the vertical scrollbar if necessary -- otherwise it is
+ // impossible to use the control with the mouse
+ msStyle |= WS_VSCROLL;
+
+ // we always want to get the notifications
+ msStyle |= LBS_NOTIFY;
+
+ // without this style, you get unexpected heights, so e.g. constraint
+ // layout doesn't work properly
+ msStyle |= LBS_NOINTEGRALHEIGHT;
+
+ wxASSERT_MSG( !(style & wxLB_MULTIPLE) || !(style & wxLB_EXTENDED),
+ _T("only one of listbox selection modes can be specified") );
+
+ if ( style & wxLB_MULTIPLE )
+ msStyle |= LBS_MULTIPLESEL;
+ else if ( style & wxLB_EXTENDED )
+ msStyle |= LBS_EXTENDEDSEL;
+
+ if ( m_windowStyle & wxLB_ALWAYS_SB )
+ msStyle |= LBS_DISABLENOSCROLL;
+ if ( m_windowStyle & wxLB_HSCROLL )
+ msStyle |= WS_HSCROLL;
+ if ( m_windowStyle & wxLB_SORT )
+ msStyle |= LBS_SORT;
+
+#if wxUSE_OWNER_DRAWN && !defined(__WXWINCE__)
+ if ( m_windowStyle & wxLB_OWNERDRAW )
+ {
+ // we don't support LBS_OWNERDRAWVARIABLE yet and we also always put
+ // the strings in the listbox for simplicity even though we could have
+ // avoided it in this case
+ msStyle |= LBS_OWNERDRAWFIXED | LBS_HASSTRINGS;
+ }
+#endif // wxUSE_OWNER_DRAWN
+
+ return msStyle;