Well, I was just trying to translate from C# to VB for you, but I've gone
back and reread the whole thread. If all you want is to be able to
get some kind of information from the parent form in which the control
resides, i'd think you could just add a public property to the parent form.
If Form1 implements an interface, it means that you must provide the
code for the properties defined in the interface. I think the line
myControl = DirectCast(Me, iUsesMyControl)
allows you to access the methods and properties in the interface
from the control. I think what this allows you to do is set the
properties in the form that implement the interface to private.
Then casting myControl to that interface allows it to see the
private properties. So only the control can see the properties,
not the whole project. So in the control, maybe you could access
myControl.FormInt and myControl.FormString and see the
properties from the form.
Can anybody verify that I'm understanding that right?
However, I don't really see the need for something this complicated
if all you are trying to do is provide the ability for the control
to see something in the form. I would think you could just add a
property to the form, and let the control access it. The code
you have for the properties (which are public) should work okay.
Then in your control, I would think you could access the
properties as Form1.FormInt and Form1.FormString.
I guess it depends on whether it's okay to make those
properties public to the rest of the project or not.
Hope that helps. If anybody can shed some wisdom here,
that would be great.
Thanks,
Robin S.