Autohidescroll sChecklistBos

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #38058
    roadrunner
    Participant

    Hey,

    how could i activated the scrollrulers for the sCheckListBox?

    I have activated and deactivated the property AutoHideScroll, but with the same result -> no horizontal ruler.

    Even when the text exceeds the right edge, only the vertical ruler appears.

    See picture, above design view, bottom run view.

    Best regards,

    Hans-Josef

    #58742
    Support
    Keymaster

    If you need to use a horz scrollbar then try this code:

    Code:
    procedure HorScrollBar(ListBox: TListBox);
    var
    i, w: Integer;
    maxwidth: Integer;
    begin
    maxwidth := 0;
    // Get largest item
    for i := 0 to ListBox.Items.Count – 1 do
    with ListBox do begin
    w := Canvas.TextWidth(Items);
    if w > maxwidth then
    maxwidth := w;
    end;

    SendMessage(ListBox.Handle, LB_SETHORIZONTALEXTENT, maxwidth + GetSystemMetrics(SM_CXFRAME), 0);
    SetWindowLong(ListBox.Handle, GWL_STYLE, GetWindowLong(ListBox.Handle, GWL_STYLE) or WS_HSCROLL);
    SetWindowPos(ListBox.Handle, 0, 0, 0, 0, 0, SWP_NOSIZE or SWP_NOMOVE or SWP_NOACTIVATE or SWP_NOZORDER or SWP_NOCOPYBITS or SWP_NOSENDCHANGING or SWP_NOREPOSITION or SWP_FRAMECHANGED);
    end;

    I found it in the Net for standard ListBox, bot TsCheckListBox should work with this code too.

    #58746
    roadrunner
    Participant

    Hey,

    thanks for the example.

    Yes it works (i have a made similar one).

    But i thought that the property AutoHideScroll should do that for me.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.