Page 1 of 1

Column Resize

Posted: 30 Jan 2014, 14:46
by sol
Hi, I use the ExplorerListView control and have added code to the HeaderClick event and that works fine. But now I see that when I resize a column that also triggers the HeaderClick event.
Is there a way, in the HeaderClick event, to check if the user is only resizing the column (then my code should not run) or actually clicking the header (in this case my code should run)?

Re: Column Resize

Posted: 30 Jan 2014, 18:36
by TiKu
There are two possible solutions:
1) Use the ColumnClick event, which is more suitable in most cases.
2) Check whether the hitTestDetails parameter has the hhtDivider flag set:

Code: Select all

If (hitTestDetails And hhtDivider) = 0 Then
  ' process click
Else
  ' ignore click
End If
Regards
TiKu

Re: Column Resize

Posted: 31 Jan 2014, 10:02
by sol
Thanks!
And I must say I am very impressed with your quick and acurate responses.
I know this is the wrong forum but…
The on the original VB6 textbox the MaxLength property works, and truncates the .Text even when you set it programmatically like txtName=”xxx”.
Your textbox MaxTextLength works only when you enter values with the keyboard and paste but not when you do txtName=”xxx”. This is not a big problem for us but it could be for others.
Have a nice weekend!
/Sölve