Autoscrolling a listbox to the bottom

Average rating
(0 votes)

This function, when called with the name of the control window and the listbox name will scroll the listbox to the very bottom, such as if you had used the scrollbar to do it.

Function autoscrolllistbox(ctrlwindow,listboxname)
	string ctrlwindow,listboxname
	controlinfo/w=$ctrlwindow $listboxname
	Wave/z w = $S_DataFolder
	if(V_Flag>0)
		listbox/z $listboxname win=$ctrlwindow,row=ceil(dimsize(w,0)-V_height/V_rowheight)
	endif
End

Back to top