2011-07-29 35 views
1

私はコード・プロジェクトでいくつかのリソースを追加しましたが、リソースへのアクセス方法はありません。 「私の」キーワードは使用できません、それは動作しません:VB.NETで "My"を使用せずに埋め込みリソースにアクセスするには?

My.Resources.blabla.ToString 

私は「私の」キーワードを使用せずに自分のリソースにアクセスするにはどうすればよいですか?
My名前空間には何もしてTY

+0

文を使用しようとしている場所にもう少しコンテキストを提供できますか? – jonsca

+0

私は、コード化されたEmbeddedResourcesメソッドでリソースを追加しました。コード化されたコードは私のためにexeをコンパイルしました。私はそのexe内の埋め込みリソースにアクセスできるようにしたいとは思っていません。 – MilMike

答えて

1

、あなたは、(blablaなど)用語を右クリックして、定義にGo]を選択することができます。それはMy名前空間の背後にあるコードを表示するか、完全なクラス名を示すオブジェクト参照を指示します。

あなたの場合、目的に合わせてこの名前空間を書き換えることができます。

Namespace My.Resources 

    '''<summary> 
    ''' A strongly-typed resource class, for looking up localized strings, etc. 
    '''</summary> 
    <Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0"), _ 
    Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _ 
    Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _ 
    Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _ 
    Friend Module Resources 

     Private resourceMan As Global.System.Resources.ResourceManager 

     Private resourceCulture As Global.System.Globalization.CultureInfo 

     '''<summary> 
     ''' Returns the cached ResourceManager instance used by this class. 
     '''</summary> 
     <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ 
     Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager 
      Get 
       If Object.ReferenceEquals(resourceMan, Nothing) Then 
        Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("WindowsApplication1.Resources", GetType(Resources).Assembly) 
        resourceMan = temp 
       End If 
       Return resourceMan 
      End Get 
     End Property 

     '''<summary> 
     ''' Overrides the current thread's CurrentUICulture property for all 
     ''' resource lookups using this strongly typed resource class. 
     '''</summary> 
     <Global.System.ComponentModel.EditorBrowsableAttribute(Global.System.ComponentModel.EditorBrowsableState.Advanced)> _ 
     Friend Property Culture() As Global.System.Globalization.CultureInfo 
      Get 
       Return resourceCulture 
      End Get 
      Set(value As Global.System.Globalization.CultureInfo) 
       resourceCulture = Value 
      End Set 
     End Property 

     '''<summary> 
     ''' Looks up a localized string similar to Blah. 
     '''</summary> 
     Friend ReadOnly Property String1() As String 
      Get 
       Return ResourceManager.GetString("String1", resourceCulture) 
      End Get 
     End Property 
    End Module 
End Namespace 
関連する問題