Resource File Woes

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

    #1

    Resource File Woes

    Hey All,

    I'm trying to add a resource file to my app but it's not working.

    I have done the following:

    -- Added a .resx file
    -- Added some strings
    -- Named the file "MyStrings.en.r esx"
    -- Add the file as a resource to the "Project" "Properties " "Resources"
    -- Tried to call the strings using:
    Dim rm As ResourceManager
    rm = New ResourceManager ("StringTabl e", Me.GetType().As sembly)
    MessageBox.Show (rm.GetString(" String1"))

    Clearly I'm missing something. How do these .resx files need to be added in
    order to work properly?

    I've looked at the documentation online and I don't see it.

    Please advise.

    Thanks,

    TC




  • Herfried K. Wagner [MVP]

    #2
    Re: Resource File Woes

    "TCook" <getmyemails2@y ahoo.comschrieb :
    I'm trying to add a resource file to my app but it's not working.
    >
    I have done the following:
    >
    -- Added a .resx file
    -- Added some strings
    -- Named the file "MyStrings.en.r esx"
    -- Add the file as a resource to the "Project" "Properties " >
    "Resources"
    -- Tried to call the strings using:
    Dim rm As ResourceManager
    rm = New ResourceManager ("StringTabl e", Me.GetType().As sembly)
    MessageBox.Show (rm.GetString(" String1"))

    Why aren't you using 'My.Resources.* '?

    --
    M S Herfried K. Wagner
    M V P <URL:http://dotnet.mvps.org/>
    V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

    Comment

    • TCook

      #3
      Re: Resource File Woes

      Hey Herfried,

      Thanks for the info. Now I see!

      I added the strings under the project properties and Voila!, I could call
      the data in code via intellisense.

      However, the above said, what about all of this stuff:



      Dim rm As ResourceManager
      rm = New ResourceManager ("StringTabl e", Me.GetType().As sembly)

      Message = New StringBuilder()
      Message.Append( rm.GetString("S tring1"))
      Message.Append( rm.GetString("S tring2"))


      Where does code like the above come into play?

      Regards,

      TC



      "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.atwrot e in message
      news:uIsQJF6$GH A.3536@TK2MSFTN GP03.phx.gbl...
      "TCook" <getmyemails2@y ahoo.comschrieb :
      >I'm trying to add a resource file to my app but it's not working.
      >>
      >I have done the following:
      >>
      >-- Added a .resx file
      >-- Added some strings
      >-- Named the file "MyStrings.en.r esx"
      >-- Add the file as a resource to the "Project" "Properties " >
      >"Resources"
      >-- Tried to call the strings using:
      >Dim rm As ResourceManager
      >rm = New ResourceManager ("StringTabl e", Me.GetType().As sembly)
      >MessageBox.Sho w(rm.GetString( "String1"))
      >
      >
      Why aren't you using 'My.Resources.* '?
      >
      --
      M S Herfried K. Wagner
      M V P <URL:http://dotnet.mvps.org/>
      V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

      Comment

      Working...