C #, WinForm after adding skin (IrisSkin2) Label settings color cannot be displayed
Workaround one: Set the Tag property value of the label to be the same as the value of the Skinengine Disabletag property. The default value is 9999
Label. Tag = 9999;
Principle:
The Skinengine.disabletag property represents the tag of a control that does not use skins.
If a control does not want to use skin, simply set the control's Tag property to the Skinengine.disabletag property value.
Workaround two: Customize the control---MyLabel
The code is as follows:
Using System;
Using System.Collections.Generic;
Using System.Linq;
Using System.Text;
Using System.Windows.Forms;
Using System.Drawing;
Namespace from
{
Class Mylabel:label
{
protected override void OnPaint (PaintEventArgs e)
{
Base. OnPaint (e);
This. ForeColor = color.red; Set the color of the label to Red (can be set to the color you want)
}
}
}
Once you've written it, regenerate it, and the custom component will appear in the toolbar, and you can use it.
Note: The MyLabel control generated using this method has only one color if you want to define multiple controls with different colors, this method is not available at this time, the best way is to set the label's forecolor to the color you want and set the Tag property to ski The Nengine.disabletag property value can be.
Transferred from C blog, unknown source
From the Lingbo Hut-----von and Super notes------
C #, WinForm after adding skin (IrisSkin2) Label settings color cannot be displayed