近日在项目中,一直被一个问题搞得头大的很,美工要把按钮图片弄成不规则的,但是在winform里实现又不仅仅是使用简单的png图片而已.在网上找到一些方法,稍微改了一点加工成项目所需. 贴出解决方案,以供日后使用: public class BitmapRegion { //创建支持位图区域的控件(目前有button,form,imagebutton) public static void CreateControlRegion(Control control, Bitmap bitmap) {…
注意: 以下代码,属性直接赋值的语法糖要vs2015以上才支持. using System.ComponentModel; using System.Drawing; using System.Windows.Forms; namespace RaywindStudio.Components { public class TabCtrlX : TabControl { public TabCtrlX() { InitializeComponent(); this.SetStyle(Cont…