Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
This function gives compile error
Message
De
03/01/2005 01:20:19
 
 
À
02/01/2005 23:25:33
Information générale
Forum:
ASP.NET
Catégorie:
Conception classe
Divers
Thread ID:
00973737
Message ID:
00973747
Vues:
16
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform