0

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)
2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by DdoubleD
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.