if (descr->style & WS_VSCROLL)
SetScrollInfo( descr->self, SB_VERT, &info, TRUE );
- if (descr->style & WS_HSCROLL)
+ if (descr->style & WS_HSCROLL && descr->horz_extent)
{
info.nPos = descr->horz_pos;
info.nPage = descr->width;
info.fMask |= SIF_DISABLENOSCROLL;
SetScrollInfo( descr->self, SB_HORZ, &info, TRUE );
}
+ else
+ {
+ if (descr->style & LBS_DISABLENOSCROLL)
+ {
+ info.nMin = 0;
+ info.nMax = 0;
+ info.fMask = SIF_RANGE | SIF_DISABLENOSCROLL;
+ SetScrollInfo( descr->self, SB_HORZ, &info, TRUE );
+ }
+ else
+ {
+ ShowScrollBar( descr->self, SB_HORZ, FALSE );
+ }
+ }
}
}
ScrollWindowEx( descr->self, 0, diff, NULL, NULL, 0, NULL,
SW_INVALIDATE | SW_ERASE | SW_SCROLLCHILDREN );
}
- if (!scroll) InvalidateRect( descr->self, NULL, TRUE );
+ else
+ InvalidateRect( descr->self, NULL, TRUE );
descr->top_item = index;
LISTBOX_UpdateScroll( descr );
return LB_OKAY;
info.nMin = 0;
info.nMax = descr->horz_extent ? descr->horz_extent - 1 : 0;
info.fMask = SIF_RANGE;
+ if (descr->style & LBS_DISABLENOSCROLL)
+ info.fMask |= SIF_DISABLENOSCROLL;
SetScrollInfo( descr->self, SB_HORZ, &info, TRUE );
}
if (descr->horz_pos > extent - descr->width)
case LB_SETCURSEL:
if (IS_MULTISELECT(descr)) return LB_ERR;
- LISTBOX_SetCaretIndex( descr, wParam, FALSE );
+ LISTBOX_SetCaretIndex( descr, wParam, TRUE );
ret = LISTBOX_SetSelection( descr, wParam, TRUE, FALSE );
if (ret != LB_ERR) ret = descr->selected_item;
return ret;