in

C1 Community

ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

How to implement a 1 column horizontal autoscroll c1List control?

Last post 10-18-2007 9:57 AM by C1_GregL. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 10-11-2007 3:18 PM

    How to implement a 1 column horizontal autoscroll c1List control?

    Hi -

    I'm trying to create a c1List control that contains one column of text.  If all of the rows have values that fit within the horizontal size of the control I do not want a horizontal scrollbar present.  If any of the entries exceed the width of the control I want to see the horizontal scrollbar.

    It seems as though the .hscrollbar.style = automatic setting should do this, but it doesn't.

    The problem is that the single column is created to match the design time width of the c1list control.  If the text does not fit in this default size the control simply truncates the text instead of increasing the column width and activating the horizontal control bar.

     If I set the columns .DefColumnWidth to something that exceeds the width of the c1List I do get the horizontal scroll bar, but then it's active all the time - even if the actual entries are narrower than the width of the c1list.

     Any help?

     Thanks!

  • 10-18-2007 9:57 AM In reply to

    • C1_GregL
    • Top 10 Contributor
    • Joined on 06-11-2007
    • Pittsburgh PA
    • Posts 500

    Re: How to implement a 1 column horizontal autoscroll c1List control?

    Hi,

     There is an AutoSize method that will adjust the column width automatically based on the longest value.  This should work for you

    C1List1.Splits(0).DisplayColumns(0).AutoSize()

     

    Regards,
    Greg L

    Filed under: ,
Page 1 of 1 (2 items)
Contact ComponentOne: 1.800.858.2739 ©1987-2008 ComponentOne LLC All Rights Reserved.