Hello Rolf, I am grateful for your assistance. I was confused. I saw nowhere in your function referencing .title? I changed text to title
All is well!! Thank you!!! > Message: 5 > Date: Thu, 17 Nov 2011 08:52:03 +0100 > From: Rolf-Werner Eilert <[email protected]> > Subject: Re: [Gambas-user] TableView Lacking Alignment Function > To: [email protected] > Message-ID: <[email protected]> > Content-Type: text/plain; charset=ISO-8859-1; format=flowed > > Am 16.11.2011 16:23, schrieb Randy Millner: >> Hello Rolf, thanks for the reply, >> I tried manually declaring padded whitespace. Example: >> TableView1.Columns[7].Title = " Amount" >> And the result was only one space being delivered to the final output: >> " Amount" >> What would be different if I wrote a function? > > Oops - I guess nothing :-) > > But - err - hm. Ok, trying it myself... > > PRIVATE FUNCTION rightbound(column AS Integer, text AS String) AS String > > IF tbk.Font.Width(text) >= tbk.Columns[column].Width THEN RETURN text > > DO > text = " " & text > LOOP UNTIL tbk.Font.Width(text) >= tbk.Columns[column].Width - 10 > > RETURN text > > END > > Then I called this with > > tbk.Columns[1].Text = rightbound(1, "Text") > > In the program I tried this tbk is the name of the TableView. And it > turned out to be fine with Width -10, otherwise it stops too late. > > Does it run for you too? Anyway, this way you have a dynamic thing that > you can call if a user changes the column's width. > > Rolf > > > ------------------------------------------------------------------------------ All the data continuously generated in your IT infrastructure contains a definitive record of customers, application performance, security threats, fraudulent activity, and more. Splunk takes this data and makes sense of it. IT sense. And common sense. http://p.sf.net/sfu/splunk-novd2d _______________________________________________ Gambas-user mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/gambas-user
