New topic: Disable ListBox Heading sort?
<http://forums.realsoftware.com/viewtopic.php?t=9829> Page 1 of 1 [ 6 posts ] Previous topic | Next topic Author Message BenH Post subject: Disable ListBox Heading sort?Posted: Thu Dec 14, 2006 5:12 am Joined: Mon Jul 17, 2006 12:05 pm Posts: 134 Location: Norfolk, England Is there a way to disable the list box sort that happens when you click on the heading. I don't want my users to sort the list if they accidentally click the heading! Thanks, Ben H Top ycarry Post subject: Posted: Thu Dec 14, 2006 5:46 am Joined: Sat Oct 01, 2005 5:28 am Posts: 191 Location: France Yes. If you set ColumnSortDirection to Don't Sort, the user can't sort the column by clicking its header. Don't Sort will block the usual calls to the SortColumn and CompareRows events. Code:ListBox1.ColumnSortDirection(0)=0 //or SortNoneDisable sort for first column. _________________ RB2006r4 - PPC MacOSX5.8 Top BenH Post subject: Posted: Thu Dec 14, 2006 5:52 am Joined: Mon Jul 17, 2006 12:05 pm Posts: 134 Location: Norfolk, England Thanks Carry Top Greiffenberg Post subject: Re: Disable ListBox Heading sort?Posted: Mon Dec 28, 2009 2:01 pm Joined: Wed May 16, 2007 1:50 am Posts: 170 Location: Denmark And is there any way that the header will not shift color when pressed? This leads me to think that I have sorted, since this is the default behavior... (Mac OS X, 10.6.2, RB2009R5.1 _________________ http://www.tvautomator.com/ Top harriew Post subject: Re: Disable ListBox Heading sort?Posted: Mon Dec 28, 2009 2:38 pm Joined: Fri Dec 01, 2006 3:09 pm Posts: 276 Location: Tennessee, USA You can put the following code in the MouseDown event of the Listbox. If the click is in the column headers it a return of True is made and therefore the header is not highlighted. Clicks outside of the headers will be honored since False is returned. Code:if me.HasHeading then if y <= me.HeaderHeight then return true end if end if return false Top Greiffenberg Post subject: Re: Disable ListBox Heading sort?Posted: Mon Dec 28, 2009 2:51 pm Joined: Wed May 16, 2007 1:50 am Posts: 170 Location: Denmark Thank you, but then I cannot resize the column width, since no clicks are coming to the headers... _________________ http://www.tvautomator.com/ Top Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending Page 1 of 1 [ 6 posts ] -- 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 rbforumnotifier@monkeybreadsoftware.de