ComponentResourceManager クラス
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
コンポーネントまたはオブジェクトのリソースを列挙するための簡単な機能を提供します。 ComponentResourceManager クラスは ResourceManager です。
public ref class ComponentResourceManager : System::Resources::ResourceManager
public class ComponentResourceManager : System.Resources.ResourceManager
type ComponentResourceManager = class
inherit ResourceManager
Public Class ComponentResourceManager
Inherits ResourceManager
- 継承
例
次のコード例では、 を使用ComponentResourceManagerしてコントロールの ToolStripButton プロパティにイメージ リソースをImage割り当てる方法を示します。
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
namespace WindowsApplication10
{
public class Form1 : Form
{
private ToolStripButton toolStripButton1;
private ToolStripButton toolStripButton2;
private ToolStripButton toolStripButton3;
private ContextMenuStrip contextMenuStrip1;
private IContainer components;
private ToolStripMenuItem toolStripMenuItem1;
private ToolStripMenuItem toolStripMenuItem2;
private ContextMenuStrip contextMenuStrip2;
private ToolStripMenuItem rearrangeButtonsToolStripMenuItem;
private ToolStripMenuItem selectIconsToolStripMenuItem;
private ToolStrip toolStrip1;
public Form1()
{
InitializeComponent();
}
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.Run(new Form1());
}
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
this.toolStrip1 = new System.Windows.Forms.ToolStrip();
this.toolStripButton1 = new System.Windows.Forms.ToolStripButton();
this.toolStripButton2 = new System.Windows.Forms.ToolStripButton();
this.toolStripButton3 = new System.Windows.Forms.ToolStripButton();
this.contextMenuStrip1 = new System.Windows.Forms.ContextMenuStrip(this.components);
this.contextMenuStrip2 = new System.Windows.Forms.ContextMenuStrip(this.components);
this.toolStripMenuItem1 = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripMenuItem2 = new System.Windows.Forms.ToolStripMenuItem();
this.rearrangeButtonsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.selectIconsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStrip1.SuspendLayout();
this.contextMenuStrip1.SuspendLayout();
this.contextMenuStrip2.SuspendLayout();
this.SuspendLayout();
//
// Associate contextMenuStrip2 with toolStrip1.
// toolStrip1 property settings follow.
//
this.toolStrip1.ContextMenuStrip = this.contextMenuStrip2;
this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripButton1,
this.toolStripButton2,
this.toolStripButton3});
this.toolStrip1.Location = new System.Drawing.Point(0, 0);
this.toolStrip1.Name = "toolStrip1";
this.toolStrip1.Size = new System.Drawing.Size(292, 25);
this.toolStrip1.TabIndex = 0;
this.toolStrip1.Text = "toolStrip1";
//
// toolStripButton1
//
this.toolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.toolStripButton1.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton1.Image")));
this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButton1.Name = "toolStripButton1";
this.toolStripButton1.Text = "toolStripButton1";
//
// toolStripButton2
//
this.toolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.toolStripButton2.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton2.Image")));
this.toolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButton2.Name = "toolStripButton2";
this.toolStripButton2.Text = "toolStripButton2";
//
// toolStripButton3
//
this.toolStripButton3.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image;
this.toolStripButton3.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton3.Image")));
this.toolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta;
this.toolStripButton3.Name = "toolStripButton3";
this.toolStripButton3.Text = "toolStripButton3";
//
// contextMenuStrip1
//
this.contextMenuStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.toolStripMenuItem1,
this.toolStripMenuItem2});
this.contextMenuStrip1.Name = "contextMenuStrip1";
this.contextMenuStrip1.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.contextMenuStrip1.Size = new System.Drawing.Size(131, 48);
//
// contextMenuStrip2
//
this.contextMenuStrip2.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
this.rearrangeButtonsToolStripMenuItem,
this.selectIconsToolStripMenuItem});
this.contextMenuStrip2.Name = "contextMenuStrip2";
this.contextMenuStrip2.RightToLeft = System.Windows.Forms.RightToLeft.No;
this.contextMenuStrip2.Size = new System.Drawing.Size(162, 48);
//
// toolStripMenuItem1
//
this.toolStripMenuItem1.Name = "toolStripMenuItem1";
this.toolStripMenuItem1.Text = "&Resize";
//
// toolStripMenuItem2
//
this.toolStripMenuItem2.Name = "toolStripMenuItem2";
this.toolStripMenuItem2.Text = "&Keep on Top";
//
// rearrangeButtonsToolStripMenuItem
//
this.rearrangeButtonsToolStripMenuItem.Name = "rearrangeButtonsToolStripMenuItem";
this.rearrangeButtonsToolStripMenuItem.Text = "R&earrange Buttons";
//
// selectIconsToolStripMenuItem
//
this.selectIconsToolStripMenuItem.Name = "selectIconsToolStripMenuItem";
this.selectIconsToolStripMenuItem.Text = "&Select Icons";
//
// Associate contextMenuStrip1 with Form1.
// Form1 property settings follow.
//
this.ClientSize = new System.Drawing.Size(292, 266);
this.ContextMenuStrip = this.contextMenuStrip1;
this.Controls.Add(this.toolStrip1);
this.Name = "Form1";
this.toolStrip1.ResumeLayout(false);
this.contextMenuStrip1.ResumeLayout(false);
this.contextMenuStrip2.ResumeLayout(false);
this.ResumeLayout(false);
this.PerformLayout();
}
}
}
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Data
Imports System.Drawing
Imports System.Text
Imports System.Windows.Forms
Public Class Form1
Inherits Form
Private toolStripButton1 As ToolStripButton
Private toolStripButton2 As ToolStripButton
Private toolStripButton3 As ToolStripButton
Private contextMenuStrip1 As ContextMenuStrip
Private components As IContainer
Private toolStripMenuItem1 As ToolStripMenuItem
Private toolStripMenuItem2 As ToolStripMenuItem
Private contextMenuStrip2 As ContextMenuStrip
Private rearrangeButtonsToolStripMenuItem As ToolStripMenuItem
Private selectIconsToolStripMenuItem As ToolStripMenuItem
Private toolStrip1 As ToolStrip
Public Sub New()
InitializeComponent()
End Sub
<STAThread()> _
Public Sub Main()
Application.EnableVisualStyles()
Application.Run(New Form1())
End Sub
Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container()
Dim resources As New System.ComponentModel.ComponentResourceManager(GetType(Form1))
Me.toolStrip1 = New System.Windows.Forms.ToolStrip()
Me.toolStripButton1 = New System.Windows.Forms.ToolStripButton()
Me.toolStripButton2 = New System.Windows.Forms.ToolStripButton()
Me.toolStripButton3 = New System.Windows.Forms.ToolStripButton()
Me.contextMenuStrip1 = New System.Windows.Forms.ContextMenuStrip(Me.components)
Me.contextMenuStrip2 = New System.Windows.Forms.ContextMenuStrip(Me.components)
Me.toolStripMenuItem1 = New System.Windows.Forms.ToolStripMenuItem()
Me.toolStripMenuItem2 = New System.Windows.Forms.ToolStripMenuItem()
Me.rearrangeButtonsToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.selectIconsToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem()
Me.toolStrip1.SuspendLayout()
Me.contextMenuStrip1.SuspendLayout()
Me.contextMenuStrip2.SuspendLayout()
Me.SuspendLayout()
'
' Associate contextMenuStrip2 with toolStrip1.
' toolStrip1 property settings follow.
'
Me.toolStrip1.ContextMenuStrip = Me.contextMenuStrip2
Me.toolStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.toolStripButton1, Me.toolStripButton2, Me.toolStripButton3})
Me.toolStrip1.Location = New System.Drawing.Point(0, 0)
Me.toolStrip1.Name = "toolStrip1"
Me.toolStrip1.Size = New System.Drawing.Size(292, 25)
Me.toolStrip1.TabIndex = 0
Me.toolStrip1.Text = "toolStrip1"
'
' toolStripButton1
'
Me.toolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
Me.toolStripButton1.Image = CType(resources.GetObject("toolStripButton1.Image"), System.Drawing.Image)
Me.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta
Me.toolStripButton1.Name = "toolStripButton1"
Me.toolStripButton1.Text = "toolStripButton1"
'
' toolStripButton2
'
Me.toolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
Me.toolStripButton2.Image = CType(resources.GetObject("toolStripButton2.Image"), System.Drawing.Image)
Me.toolStripButton2.ImageTransparentColor = System.Drawing.Color.Magenta
Me.toolStripButton2.Name = "toolStripButton2"
Me.toolStripButton2.Text = "toolStripButton2"
'
' toolStripButton3
'
Me.toolStripButton3.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
Me.toolStripButton3.Image = CType(resources.GetObject("toolStripButton3.Image"), System.Drawing.Image)
Me.toolStripButton3.ImageTransparentColor = System.Drawing.Color.Magenta
Me.toolStripButton3.Name = "toolStripButton3"
Me.toolStripButton3.Text = "toolStripButton3"
'
' contextMenuStrip1
'
Me.contextMenuStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.toolStripMenuItem1, Me.toolStripMenuItem2})
Me.contextMenuStrip1.Name = "contextMenuStrip1"
Me.contextMenuStrip1.RightToLeft = System.Windows.Forms.RightToLeft.No
Me.contextMenuStrip1.Size = New System.Drawing.Size(131, 48)
'
' contextMenuStrip2
'
Me.contextMenuStrip2.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.rearrangeButtonsToolStripMenuItem, Me.selectIconsToolStripMenuItem})
Me.contextMenuStrip2.Name = "contextMenuStrip2"
Me.contextMenuStrip2.RightToLeft = System.Windows.Forms.RightToLeft.No
Me.contextMenuStrip2.Size = New System.Drawing.Size(162, 48)
'
' toolStripMenuItem1
'
Me.toolStripMenuItem1.Name = "toolStripMenuItem1"
Me.toolStripMenuItem1.Text = "&Resize"
'
' toolStripMenuItem2
'
Me.toolStripMenuItem2.Name = "toolStripMenuItem2"
Me.toolStripMenuItem2.Text = "&Keep on Top"
'
' rearrangeButtonsToolStripMenuItem
'
Me.rearrangeButtonsToolStripMenuItem.Name = "rearrangeButtonsToolStripMenuItem"
Me.rearrangeButtonsToolStripMenuItem.Text = "R&earrange Buttons"
'
' selectIconsToolStripMenuItem
'
Me.selectIconsToolStripMenuItem.Name = "selectIconsToolStripMenuItem"
Me.selectIconsToolStripMenuItem.Text = "&Select Icons"
'
' Associate contextMenuStrip1 with Form1.
' Form1 property settings follow.
'
Me.ClientSize = New System.Drawing.Size(292, 266)
Me.ContextMenuStrip = Me.contextMenuStrip1
Me.Controls.Add(toolStrip1)
Me.Name = "Form1"
Me.toolStrip1.ResumeLayout(False)
Me.contextMenuStrip1.ResumeLayout(False)
Me.contextMenuStrip2.ResumeLayout(False)
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
コンストラクター
ComponentResourceManager() |
ComponentResourceManager クラスの新しいインスタンスを既定値で初期化します。 |
ComponentResourceManager(Type) |
指定した ComponentResourceManager の情報に基づいて、サテライト アセンブリでリソースを検索する Type を作成します。 |
フィールド
BaseNameField |
ResourceManager がリソースを検索するリソース ファイルのルート名を指定します。 (継承元 ResourceManager) |
MainAssembly |
リソースを含むメイン アセンブリを指定します。 (継承元 ResourceManager) |
ResourceSets |
古い.
カルチャから Hashtable オブジェクトへの割り当てを返す ResourceSet を格納します。 (継承元 ResourceManager) |
プロパティ
BaseName |
ResourceManager がリソースを検索するリソース ファイルのルート名を取得します。 (継承元 ResourceManager) |
FallbackLocation |
既定のフォールバック リソースの取得元の場所を取得または設定します。 (継承元 ResourceManager) |
IgnoreCase |
リソース マネージャーが GetString(String) メソッドと GetObject(String) メソッドで大文字と小文字を区別しないリソースの検索を許可しているかどうかを示す値を取得または設定します。 (継承元 ResourceManager) |
ResourceSetType |
ResourceSet オブジェクトの構築にリソース マネージャーが使用するリソース セット オブジェクトの型を取得します。 (継承元 ResourceManager) |
メソッド
ApplyResources(Object, String) |
オブジェクトの対応するプロパティにリソースの値を適用します。 |
ApplyResources(Object, String, CultureInfo) |
オブジェクトの対応するプロパティにリソースの値を適用します。 |
Equals(Object) |
指定されたオブジェクトが現在のオブジェクトと等しいかどうかを判断します。 (継承元 Object) |
GetHashCode() |
既定のハッシュ関数として機能します。 (継承元 Object) |
GetObject(String) |
指定した文字列以外のリソースの値を返します。 (継承元 ResourceManager) |
GetObject(String, CultureInfo) |
指定されたカルチャ用にローカライズされている指定された文字列以外のリソースの値を取得します。 (継承元 ResourceManager) |
GetResourceFileName(CultureInfo) |
指定した CultureInfo オブジェクトのリソース ファイルの名前を生成します。 (継承元 ResourceManager) |
GetResourceSet(CultureInfo, Boolean, Boolean) |
特定のカルチャのリソース セットを取得します。 (継承元 ResourceManager) |
GetStream(String) |
指定したリソースからアンマネージ メモリ ストリーム オブジェクトを返します。 (継承元 ResourceManager) |
GetStream(String, CultureInfo) |
指定したカルチャを使用し、指定したリソースからアンマネージ メモリ ストリーム オブジェクトを返します。 (継承元 ResourceManager) |
GetString(String) |
指定されている文字列リソースの値を返します。 (継承元 ResourceManager) |
GetString(String, CultureInfo) |
指定したカルチャにローカライズされている文字列リソースの値を返します。 (継承元 ResourceManager) |
GetType() |
現在のインスタンスの Type を取得します。 (継承元 Object) |
InternalGetResourceSet(CultureInfo, Boolean, Boolean) |
リソース セットを検索するための実装を提供します。 (継承元 ResourceManager) |
MemberwiseClone() |
現在の Object の簡易コピーを作成します。 (継承元 Object) |
ReleaseAllResources() |
リソース マネージャーに、すべての Close() オブジェクトの ResourceSet メソッドを呼び出し、すべてのリソースを解放するように指示します。 (継承元 ResourceManager) |
ToString() |
現在のオブジェクトを表す文字列を返します。 (継承元 Object) |
適用対象
.NET
フィードバック
https://aka.ms/ContentUserFeedback」を参照してください。
以下は間もなく提供いたします。2024 年を通じて、コンテンツのフィードバック メカニズムとして GitHub の issue を段階的に廃止し、新しいフィードバック システムに置き換えます。 詳細については、「フィードバックの送信と表示