Label of the protruding Effect

Source: Internet
Author: User

The three borderstyles of the label controls in the existing winform do not have the final effect, none, fixedsingle, and fixed3d.
To create a protruding effect, we need to inherit a label. Add:

Protected override createparams
{
Get
{
Createparams CP = base. createparams;
CP. exstyle & = (~ Nativemethods. ws_exclientedge );
CP. Style & = (~ Nativemethods. ws_border );

Switch (borderstyle)
{
Case borderstyle. fixed3d:
CP. exstyle | = nativemethods. ws_exclientedge;
Break;
Case borderstyle. fixedsingle:
CP. Style | = nativemethods. ws_border;
Break;
}
Return CP;
}
}

Public override borderstyle
{
Get
{
Return borderstyle;
}
Set
{
If (borderstyle! = Value)
{
If (! Enum. isdefined (typeof (borderstyle), value ))
{
Throw new invalidenumargumentexception ("value", (INT) value, typeof (borderstyle ));
}
Borderstyle = value;
Updatestyles ();
}
}
}

Look at the results. The above is the label.
(The code is the usercontrol code in msdn that creates a border. I don't know it in the morning)

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.