` Printed Icetips Article

Icetips Article



Par2: ABC - How do you know Header is pressed?
2007-10-23 -- John Christ
 
> Is there a real simple way to know if the header is being pressed in a 
> ListBox.  (Not a Browse).
>
> I want to trap it and resort the listbox.
>
> Right now, I have a bunch of code looking at MOUSEX and MOUSEY and 
> checking the ListControl's width, height and XPOS ... and now I'm 
> wondering if I made it too complicated.

Alert MouseLeft.  In the AlertKey embed:

CASE KEYCODE()
OF MouseLeft
  IF ?List1{PROPLIST:MouseDownRow} = 0 ! Header
    SelectedColumn# = ?List1{PROPLIST:MouseDownField}
    ! Do what you gotta do here

Shankar notes:

And, don't forget the ListZones.

    CASE EVENT()
    OF EVENT:AlertKey
      IF KEYCODE() = MouseLeft2 AND ?QueryResult{PROPLIST:MouseDownZone} = 
LISTZONE:Header AND SELF.Request <> ViewRecord
         Col# = ?QueryResult{PROPLIST:MouseDownField}



Printed November 21, 2024, 6:35 am
This article has been viewed/printed 35251 times.