C #, WinForm after adding skin (IrisSkin2) Label settings color cannot be displayed

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.