ControlExtensionsSetStyle Method

Sets a specified ControlStyles flag to either or . It calls the protected Control.SetStyle method on the specified control as if it was a public method.

Definition

Namespace: KGySoft.WinForms
Assembly: KGySoft.WinForms (in KGySoft.WinForms.dll) Version: 5.0.1
C#
public static void SetStyle(
	this Control control,
	ControlStyles flags,
	bool value
)

Parameters

control  Control
The control to set.
flags  ControlStyles
The ControlStyles bits to set.
value  Boolean
true to apply the specified style to the control; otherwise, false.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Control. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

See Also