reflection? Not sure how to do this...

  • Thread starter Thread starter Jordan Bowness
  • Start date Start date
J

Jordan Bowness

I have an MDI parent with 1 mdi child. I'd like to be able to run a
routine on the parent to enumerate the handled events on the child form.

Specifically, I have a control on the parent which I want to update
depending on what keydown events are handled by the child form.

Any suggestions? I've tried a couple of times to take a crack at it
using this:

Dim myAssemblies As [Assembly]() = Thread.GetDomain().GetAssemblies()

But I think I may be on the wrong path.

Thanks kindly,

================
Jordan Bowness
================
 
I have an MDI parent with 1 mdi child. I'd like to be able to run a
routine on the parent to enumerate the handled events on the child form.

Specifically, I have a control on the parent which I want to update
depending on what keydown events are handled by the child form.

Any suggestions? I've tried a couple of times to take a crack at it
using this:

Dim myAssemblies As [Assembly]() = Thread.GetDomain().GetAssemblies()

But I think I may be on the wrong path.

Thanks kindly,

================
Jordan Bowness
================

Why not pass an instance of the parent form to the child, through a
property or even the constructor...

private parentform as form

public sub new() ' default
initializecontrols()
end sub


public sub new(byval parentform as form)
me.parentform = parentform
initializecontrols()
end sub


dim new child as new childform(me)

then your child form is free to call any methods/poperties of your
parent form.
 
My idea here was that the custom toolbar control that I have on the
MDIParent would automatically render itself based on events being
handled by the active MDI Child.

Specifically, if the MDIChild wasn't handling certain keypress events
(fired by a control on the child form), the toolbar control on the MDI
parent would gray out certain commands.

I though doing some reflection would be an elegant way to be able to
simply add a few event handlers on any of the child forms and need not
to worry about inheriting specific properties from a different form.

If I don't hear back from anyone, I'll just assume this is a dumb idea
and do it as you suggest Tom. :o)

Thanks,


================
Jordan Bowness
================
 
Back
Top