Real Software Forums

Auto-resizing columns in ListBox
Page 1 of 1

Author:  gemini0x4d [ Mon May 27, 2013 11:44 am ]
Post subject:  Auto-resizing columns in ListBox


I searched this topic, but I didn't find a proper solution yet.

My program retrieves data from a MySQL database and displays it within a ListBox. Unfortunately, there seems to be no option to automatically adapt the column widths to the data within the cells. I'm looking for a pure RS solution without external plugins. Can you help me with this problem?

Kind regards,

Author:  DaveS [ Mon May 27, 2013 12:48 pm ]
Post subject:  Re: Auto-resizing columns in ListBox


As you load each cell... keep track of the max width of the data (using g.stringwidth)

when the listbox is loaded, add a bit of padding to your value, and set the column widths

Author:  gemini0x4d [ Tue May 28, 2013 8:02 am ]
Post subject:  Re: Auto-resizing columns in ListBox

Works! Thank you :-)

Page 1 of 1 All times are UTC - 5 hours
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group