Q: Is there a way to "format paint" the formatting of a form element in VS Code Winforms? I'm building a C# Winform with .Net Core using Visual Studio. It's working decently enough, but the challenge is that I took the time to tweak a textbox so it looks how I want. I'm planning on adding several more and I'd rather not have to manually pick all the style options again if I can avoid it.
Basically I'm using a textbox as an info box (maybe not the best way, but it was the only way to do this that I was able to find.

For now, I manually set the values for the two info boxes, but when I add more, is there any way to copy the key formatting options so I don't have to manually select every attribute every time?

A: In winforms you can always derive your own controls from existing ones. After the first successful compilation they appear automatically in the Toolbox, from where you can drag and drop them to your form.
public class InfoBox : TextBox
{
    private static readonly Font InfoFont = new Font("Arial", 9);

    public InfoBox()
    {
        // Set initial properties
        ReadOnly = true;
        Multiline = true;
        BackColor = Color.Silver;
        Font = InfoFont;
    }
}

You can also add new properties and override methods to change the behaviour. E.g., you can completely change the look by overriding OnPaint. The new properties will appear in the Properties window where you can set them manually.
An info box could also be based on a Label control.
See also

*

*Developing Custom Windows Forms Controls with the .NET Framework

*How to: Inherit from Existing Windows Forms Controls

*Walkthrough: Inherit from a Windows Forms Control with C#
This code example requires these usings:
using System.Drawing;
using System.Windows.Forms;


A: The easiest way that I've found is to simply highlight the boxes, copy and paste in the form designer itself. The new fields will be given generic names that can be easily changed, but if you want the rest of their formatting to be the same, this does it. Note it doesn't automatically copy any events (that I can see) so you can still manually set those when/if necessary.
