<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to set scroll position for list boxes in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-set-scroll-position-for-list-boxes/m-p/327645#M57685</link>
    <description>&lt;P&gt;I am getting&lt;FONT color="#FF6600"&gt;&amp;nbsp;Object 'ListBoxBox' does not recognize the message 'get scroll position'&lt;/FONT&gt; errors when trying to set the scroll location for a list box.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My script automatically selects a value from the list, but if that value is not currently visible, it looks like the list box has no selection. It would be good for me if I could get it to scroll down to make sure the user doesn't get confused by this. I've been looking at the Set Scroll Position documentation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know how to do this? Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
listOfItems = {};
for (i = 1, i &amp;lt;= 30, i++,
	insert into(listOfItems,"Item " || char(i));
);

New Window( "Example",
	fontobj = lb = List Box(
		listOfItems,
		width( 200 ),
		max selected( 2 ),
		nlines( 6 )
	)
);

lb &amp;lt;&amp;lt; set selected(7);&lt;BR /&gt;&lt;BR /&gt;//lb&amp;nbsp;&amp;lt;&amp;lt;&amp;nbsp;somehow&amp;nbsp;scroll&amp;nbsp;down&amp;nbsp;to&amp;nbsp;make&amp;nbsp;position&amp;nbsp;7&amp;nbsp;visible!&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 09 Jun 2023 23:41:53 GMT</pubDate>
    <dc:creator>MarkJohnson</dc:creator>
    <dc:date>2023-06-09T23:41:53Z</dc:date>
    <item>
      <title>How to set scroll position for list boxes</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-set-scroll-position-for-list-boxes/m-p/327645#M57685</link>
      <description>&lt;P&gt;I am getting&lt;FONT color="#FF6600"&gt;&amp;nbsp;Object 'ListBoxBox' does not recognize the message 'get scroll position'&lt;/FONT&gt; errors when trying to set the scroll location for a list box.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My script automatically selects a value from the list, but if that value is not currently visible, it looks like the list box has no selection. It would be good for me if I could get it to scroll down to make sure the user doesn't get confused by this. I've been looking at the Set Scroll Position documentation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know how to do this? Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
listOfItems = {};
for (i = 1, i &amp;lt;= 30, i++,
	insert into(listOfItems,"Item " || char(i));
);

New Window( "Example",
	fontobj = lb = List Box(
		listOfItems,
		width( 200 ),
		max selected( 2 ),
		nlines( 6 )
	)
);

lb &amp;lt;&amp;lt; set selected(7);&lt;BR /&gt;&lt;BR /&gt;//lb&amp;nbsp;&amp;lt;&amp;lt;&amp;nbsp;somehow&amp;nbsp;scroll&amp;nbsp;down&amp;nbsp;to&amp;nbsp;make&amp;nbsp;position&amp;nbsp;7&amp;nbsp;visible!&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 09 Jun 2023 23:41:53 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-set-scroll-position-for-list-boxes/m-p/327645#M57685</guid>
      <dc:creator>MarkJohnson</dc:creator>
      <dc:date>2023-06-09T23:41:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to set scroll position for list boxes</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-set-scroll-position-for-list-boxes/m-p/327689#M57689</link>
      <description>&lt;P&gt;Neither the ListBox() or the ListBoxBox() objects accept scroll position messages.&amp;nbsp; Those messages work with ScrollBox();&amp;nbsp; See the example below, and read about it in the Scripting Guide&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;win = New Window( "Example",
sb = Scroll Box(
Size( 150, 75 ),
List Box(
{"First Item", "Second Item",
"Third Item", "Fourth Item",
"Fifth Item"},
width( 200 ),
max selected( 2 ),
nlines( 6 )
)
)
);
win &amp;lt;&amp;lt; Set Window Size( 300, 200 );
sb &amp;lt;&amp;lt; Set Scrollers( 1, 1 ); // enable both scroll bars
sb &amp;lt;&amp;lt; Set Scroll Position( 0, 10 ); /* position the scrollers on&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2020 22:38:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-set-scroll-position-for-list-boxes/m-p/327689#M57689</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-10-28T22:38:22Z</dc:date>
    </item>
  </channel>
</rss>

