StrataFrame Forum

Reflection

http://forum.strataframe.net/Topic5337.aspx

By Paul Chase - 12/15/2006

I need to create some documentation and am using reflection to go through the project's in the solution and create a chm. So far it is coming along real nice but I cant figure out why this wont work.

I am trying to loop through a forms control's collection and only grab the controls that are Strataframe Controls, for instance a SF text box on the test form and the code below does not seem to find it. I only want to show contols that can be bound to a BO as I creating a Form level bound controls section.

For Each loCtl As System.Windows.Forms.Control In _form.Controls

If loCtl.GetType.IsSubclassOf(GetType(MicroFour.StrataFrame.UI.Windows.Forms.Textbox)) Then

--------Doesnt seem to work but if remoce the if statement it works

 

 

By Trent L. Taylor - 12/15/2006

You also need to check to see if the control IS an SF control:

loCtl.GetType() Is GetType(MicroFour.StrataFrame.UI.Windows.Forms.Textbox)

IsSubClass doesn't work for the class itself.

By Paul Chase - 12/15/2006

Thanks Trent I think I was looking for a way to get any control that was a strata frame control. Manly to be ablt to look for the Business object property and the field property. But I will just have to look at each type of control seperately.

Here is what the page look's like. Really the bottom 2 controls will go into another unbound controls section.

By Trent L. Taylor - 12/15/2006

Looks good Smile
By Paul Chase - 12/15/2006

Thanks it is coming along. I hate documentationHehe But this is acually kinda fun except for the Html. Thanks again for the help
By Trent L. Taylor - 12/15/2006

I completely understand Smile