[RESOLVED] Intercepting ListView ColumnHeaders.Text Property?
I have a User Control (that my former co-worker created many years ago) that has a ListView on it. It's some sort of a ListView+ with many advanced features that simple ListView doesn't support directly.
We're now translating our apps due to some market spreading. What i need to do is to intercept ColumnHeader's .Text Property being changed. Is it possible? I'm puzzled.
App is simply huge and i can't see any other fast solutions (i have few days and i don't want to go through all the code line by line).
Here's a general idea:
Code:
'Form
Dim x As ColumnHeader
Set x = UserControl1.ColumnHeaders.Add()
x.Text = "something" 'can i somehow intercept this?
'User Control
Public Property Get ColumnHeaders() As ColumnHeaders
Set ColumnHeaders = lvw.ColumnHeaders
End Property
-gav
Re: Intercepting ListView ColumnHeaders.Text Property?
You can change UC's tag, send some flag to parent, whatever ... but you'd still need to implement some kind of "monitoring routine" - timer comes to mind first.
You can have some hidden form with the timer "monitoring" every open form - if you modify UC to change its tag property when columnheader gets changed then since it's a global change then implementing the rest shouldn't take much effort.
Tag can hold "old value" and the "new value" but that really depends on what you need to know at the moment.
... just an idea ...
Re: Intercepting ListView ColumnHeaders.Text Property?
This could work but could also fail (i'm just saying it's not 100%). I'm thinking more about intercepting the .Text Property directly.
However, i've gone through the project (run it) and for now everything works correctly (in each Form_Load() there is a Call that translates all the Controls). But... because many programmers work on this i still want to implement it... in case somebody forgets something.
In case there's no other solution i just might dig more into yours, RB.
Re: Intercepting ListView ColumnHeaders.Text Property?
No problem, I'll stop by shall I get another idea... :wave:
1 Attachment(s)
Re: Intercepting ListView ColumnHeaders.Text Property?
OK. Now I've made a simpler solution that stays in User Control... and it works :) (will still test it some more)
I'm posting it in case somebody else encounters the same problem.
Thanks anyways, RB.
Seems resolved... took me a day tough :)