Results 1 to 5 of 5

Thread: [RESOLVED] Intercepting ListView ColumnHeaders.Text Property?

  1. #1

    Thread Starter
    PowerPoster gavio's Avatar
    Join Date
    Feb 2006
    Location
    GMT+1
    Posts
    4,462

    Resolved [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

  2. #2
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    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 ...

  3. #3

    Thread Starter
    PowerPoster gavio's Avatar
    Join Date
    Feb 2006
    Location
    GMT+1
    Posts
    4,462

    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.

  4. #4

  5. #5

    Thread Starter
    PowerPoster gavio's Avatar
    Join Date
    Feb 2006
    Location
    GMT+1
    Posts
    4,462

    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
    Attached Files Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width