I'm trying to make custom panels, but I can't even set the styles without getting errors

MainForm.SetStyle(System.Windows.Forms.ControlStyles.DoubleBuffer, true);
			MainForm.SetStyle(System.Windows.Forms.ControlStyles.AllPaintingInWmPaint, false);
			MainForm.SetStyle(System.Windows.Forms.ControlStyles.ResizeRedraw, true);
			MainForm.SetStyle(System.Windows.Forms.ControlStyles.UserPaint, true);
			MainForm.SetStyle(System.Windows.Forms.ControlStyles.SupportsTransparentBackColor, true);

Throws errors saying

An object reference is required for the non-static field, method, or property 'System.Windows.Forms.Control.SetStyle(System.Windows.Forms.ControlStyles, bool)' (CS0120)