Looping open windows, manipulating controls.

In a desktop application - I have some code to loop through all the open windows and work with windows of a certain super, so far - no problems.

What I want to do is either

  • manipulate a control on this window and populate it with data
  • call a method which in turn populates the control

Not really bothered which way round we do this. Any ideas how to make this happen - I’m going round in circles here!

Oh hell - put this in the wrong channel - can we get this put in General please…

Cast your window and call the method or manipulate the control

MySuper(window(i)).MyMethod

Beautiful - thanks Peter.

You know how sometimes you know the answer is simple but you keep missing it!

Yep. Happens several times a day to me.

Are you sure you don’t need some kind of notification system instead where a central body “informs” its registrants of a change?

Sure - that would work as well.

I’m just experimenting with some stuff and had a mental roadblock…