Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
This function gives compile error
Message
From
03/01/2005 01:20:19
 
 
To
02/01/2005 23:25:33
General information
Forum:
ASP.NET
Category:
Class design
Miscellaneous
Thread ID:
00973737
Message ID:
00973747
Views:
15
This message has been marked as the solution to the initial question of the thread.
Does your class have

Imports System.Windows.Form

~~Bonnie



>I have a Function.dll which includes several function. I tried to add the following:
>
>
>    Public Shared Function FindControlByFieldName(ByVal frm As Form, ByVal name As String) As Object
>        Dim t As System.Type = frm.GetType()
>
>        Dim pi As System.Reflection.PropertyInfo = _
>            t.GetProperty(name, _
>                System.Reflection.BindingFlags.Public Or _
>                System.Reflection.BindingFlags.NonPublic Or _
>                System.Reflection.BindingFlags.Instance Or _
>                System.Reflection.BindingFlags.DeclaredOnly)
>
>        If Not pi Is Nothing Then
>            Return pi.GetValue(frm, Nothing)
>        End If
>
>        Dim fi As System.Reflection.FieldInfo = _
>            t.GetField(name, _
>                System.Reflection.BindingFlags.Public Or _
>                System.Reflection.BindingFlags.NonPublic Or _
>                System.Reflection.BindingFlags.Instance Or _
>                System.Reflection.BindingFlags.DeclaredOnly)
>
>        If fi Is Nothing Then
>            Return Nothing
>        End If
>
>        Return fi.GetValue(frm)
>    End Function
>
>
>Once added, the Form parameter is underlined which demonstrates an error. Anyone would know what I have to do when adding this function in a class to avoid the error? When I include it in my Form, I don't have any problem.
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform