My.Rescources as a collection

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a simply way of iterating through My.Recources?
i need to be able to do something like (psudo code)

For Each resource as ResourceItem in My.Resources
if resource.key = theResourceIWant then
return resource.value
end if
next

*guy*
 
easy really!

''' <summary>
''' function to return the value of a resource for a the current culture
''' </summary>
''' <param name="rescourceName">the name of the resource to find</param>
''' <returns>the value of the resource</returns>
''' <remarks></remarks>
Public Shared Function GetResourceValue(ByVal rescourceName As String)
As String
Dim rs As System.Resources.ResourceSet =
My.Resources.Resources.ResourceManager.GetResourceSet(Thread.CurrentThread.CurrentUICulture, True, True)
Return rs.GetString(rescourceName)
End Function
 
Back
Top