Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Fri Nov 24, 2017 8:15 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Auto-resizing columns in ListBox
PostPosted: Mon May 27, 2013 11:44 am 
Offline

Joined: Thu Jan 21, 2010 5:47 pm
Posts: 2
Hi,

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,
gemini


Top
 Profile  
Reply with quote  
 Post subject: Re: Auto-resizing columns in ListBox
PostPosted: Mon May 27, 2013 12:48 pm 
Offline
User avatar

Joined: Sun Aug 05, 2007 10:46 am
Posts: 4931
Location: San Diego, CA
easy.

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

_________________
Dave Sisemore
iMac I7[2012], OSX Mountain Lion 10.8.3 RB2012r2.1
Note : I am not interested in any solutions that involve custom Plug-ins of any kind


Top
 Profile  
Reply with quote  
 Post subject: Re: Auto-resizing columns in ListBox
PostPosted: Tue May 28, 2013 8:02 am 
Offline

Joined: Thu Jan 21, 2010 5:47 pm
Posts: 2
Works! Thank you :-)


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group