Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Basic Realbasic > Re: Listbox hea...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 9 Topic 3312 of 3326
Post > Topic >>

Re: Listbox header question

by Dale Arends <dalearendssafe@[EMAIL PROTECTED] > Apr 12, 2008 at 06:30 PM

befr@[EMAIL PROTECTED]
 (Bernd Fröhlich) wrote in news:1if8tgd.1aul7y31ehj6diN%
befr@[EMAIL PROTECTED]
> RB 2008 / OS X.5.2
> 
> I´ve got a listbox that should not be sortet when a user clicks in a
> header. This works fine with
> Listbox1.ColumnSortDirection(i)=Listbox.SortNone
> BUT the header where the user clicks is still highlighted.
> How do I get rid of the highlight so that simply nothing happens when
> someone clicks into a header?
> 

First, add a zero-width column to the listbox.  Next, put the following 
code into the listbox's HeaderPressed method.

  if myclick = true then
    myclick = False
    me.PressHeader(x) //x must be the zero-width column's number
    
  Else
    myclick = True
  end if
  return true

Lastly, create a global property named 'myclick'.  

That should do it.  Regardless of which column header is clicked, nothing 
should happen.  As soon as the user moves the cursor off the header, the 
highlight should go away.

The way is works is ugly but effective.  Calling PressHeader from within 
the HeaderPressed method is recursive and will lead to a Stack Overflow 
error.  So, we essentially set up a flag that tells the method if it was 
called by the user's mouseclick and PressHeader should be called, or by 
the method itself and do nothing.

- Dale
 




 9 Posts in Topic:
Listbox header question
befr@[EMAIL PROTECTED] (  2008-04-11 17:21:56 
Re: Listbox header question
Dale Arends <dalearend  2008-04-12 18:30:12 
Re: Listbox header question
befr@[EMAIL PROTECTED] (  2008-04-13 11:07:41 
Re: Listbox header question
befr@[EMAIL PROTECTED] (  2008-04-13 12:06:33 
Re: Listbox header question
Dale Arends <dalearend  2008-04-13 12:55:18 
Re: Listbox header question
befr@[EMAIL PROTECTED] (  2008-04-14 08:36:38 
Re: Listbox header question
support@[EMAIL PROTECTED]  2008-04-14 11:42:28 
Re: Listbox header question
Dale Arends <dalearend  2008-04-14 19:11:15 
Re: Listbox header question
befr@[EMAIL PROTECTED] (  2008-04-15 09:12:30 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sat Jul 26 2:46:03 CDT 2008.