New topic: 

ListBox header pressed - disable blue appearance

<http://forums.realsoftware.com/viewtopic.php?t=31442>

       Page 1 of 1
   [ 1 post ]                 Previous topic | Next topic         Author  
Message       Markus Winter           Post subject: ListBox header pressed - 
disable blue appearancePosted: Sun Dec 06, 2009 4:25 pm                        
Joined: Sun Feb 19, 2006 4:00 pm
Posts: 479
Location: Heidelberg, Germany              There is one hng about the listbox 
which I found annoying - once the header is clicked on, it has a blue 
appearance and its arrow (ascending or descending, toggling every time you 
click), which is confusing for the user (the column isn't sorted but the visual 
indicators are set).

Terry just came up with the following solution on the mailing list which works 
great and which I thought I share here:

Code:Function HeaderPressed(column as Integer) As Boolean
  me.headingIndex= -1
End Function

Sub Open()
  me.headingIndex= 0  //warms up the listBox (try without it, you'll see)
  me.headingIndex= -1
  me.ColumnSortDirection(-1)=0
End Sub


Note that the code in the open event has to be before any other code (like 
adding rows) or the result might not quite be what you expect - try this in the 
open event

Code:Sub Open()
  dim i as integer
  
  for i = 0 to 10
  me.AddRow Str(i)
  me.cell(i,1) = "text" + Str(i)
  next i
  
  me.headingIndex= 0  //warms up the listBox (try without it, you'll see)
  me.headingIndex= -1
  me.ColumnSortDirection(-1)=0
End Sub


Hope you'll find this useful too

Markus   
                            Top           Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 1 post ]     
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to