ComponentResourceManager resources = new ComponentResourceManager(typeof(Form1)); resources.ApplyResources(textBox1, "textBox1");
ComponentResourceManager resources = new ComponentResourceManager(typeof(Form1)); resources.ApplyResources(menuStrip1, "menuStrip1");Here, we create an instance of the ComponentResourceManager class and pass the Type of the form that contains the control as an argument. We then call the ApplyResources method and pass the control object and the name of the resource key as arguments. Package/Library: The ComponentResourceManager class is part of the System.ComponentModel namespace in the .NET Framework.