Resource Files

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bob

    Resource Files

    Hi,
    Trying to access some resource files that I originally created in a C# proj.
    Added a copy of the "String1.re sx" file to the VB project then opened My
    Project and added the file to the resources.
    This seemed happy enough in that it created a text file icon in the
    resources panel.
    But I am lost as to how to access it.
    In C#
    I would create a resource manager using a reference to the file in the
    constructor.
    rm = new ResourceManager ("WidgetProj.St ringRes1",
    Assembly.GetExe cutingAssembly( ));

    The VB version of this executes without error but I can't get access to the
    strings.

    i.e.

    myString =rm.GetString(" String15") gives an error "Could not find any
    resource appropriate for the specified culture or the neutral culture..."

    Intellisense exposes the Resource File through the My.Resources.St ringRes1
    but not in any useful way that I can see.

    I tried assigning to the Default resource manager exposed by My.Resources.
    Although this executes OK it only returns empty strings

    rm = My.Resources.Re sourceManager()

    Me.sbpSms.Text = rm.GetString("S tringRes1.Strin g121")

    or

    Me.sbpSms.Text = rm.GetString("S tring121")

    both return empty strings. What is the correct way to access string resource
    files that have been added to the project?


Working...