Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid Column Header Click
Message
From
30/03/2005 15:22:44
 
 
To
30/03/2005 13:29:45
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9
Miscellaneous
Thread ID:
01000019
Message ID:
01000071
Views:
19
This message has been marked as the solution to the initial question of the thread.
>Hi!
>
>Is there an easy way to figure out if the click event in the (Grid Column) Header happened because the user clicked on the header or because the user moved the Column Position (Changed the ColumnOrder of a Grid's Column)
>
>I am using VFP 9.0
>
>Sarosh

You have to capture the Moved event into the Click event
* Header
* MouseDown
LPARAMETERS nButton, nShift, nXCoord, nYCoord
BINDEVENT(m.this.Parent,"Moved",this,"MouseUp",1) && or put this.ColumnReordered = .T.
                                                  && into Column.Moved
ADDPROPERTY(this,"ColumnReordered",.F.) && or add this to the Header subClass

* MouseUp
LPARAMETERS nButton, nShift, nXCoord, nYCoord
* I look a bug here, NODEFAULT is ignored
IF EMPTY(PARAMETERS()) && OR USE AEVENT() or use a SpecialMetodh
  this.ColumnReordered = .T. &&  or put this code into Column
ELSE
  UNBINDEVENTS(m.this.Parent,"Moved",this,"MouseUp")
ENDIF

* Click
WAIT WINDOWS IIF(m.this.ColumnReordered,"Order","Click") NOWAIT TIMEOUT 10
Previous
Reply
Map
View

Click here to load this message in the networking platform