using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace TomWinform.CustomerControl
{
public partial class VistaLabel : Control
{
private StringAlignment verticalAlignment = StringAlignment.Center;
private StringAlignment horizontalAlignment = StringAlignment.Center;
private Color lineColor = Color.Black;
private Color leftLineColor = Color.Black;
private Color RightLineColor = Color.Black;
private Color TopLineColor = Color.Black;
private Color BottomLineColor = Color.Black;
public VistaLabel()
{
InitializeComponent();
}
protected override void OnPaint(PaintEventArgs pe)
{
StringFormat format = new StringFormat();
&nb
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace TomWinform.CustomerControl
{
public partial class VistaLabel : Control
{
private StringAlignment verticalAlignment = StringAlignment.Center;
private StringAlignment horizontalAlignment = StringAlignment.Center;
private Color lineColor = Color.Black;
private Color leftLineColor = Color.Black;
private Color RightLineColor = Color.Black;
private Color TopLineColor = Color.Black;
private Color BottomLineColor = Color.Black;
public VistaLabel()
{
InitializeComponent();
}
protected override void OnPaint(PaintEventArgs pe)
{
StringFormat format = new StringFormat();
&nb

这篇博客介绍了如何在Winform应用中创建一个自定义的VistaLabel控件,该控件支持文本的垂直和水平对齐方式,并且可以自定义边框颜色。文章详细展示了控件的OnPaint方法,用于绘制文本和边框,并提供了相应的属性设置方法。
最低0.47元/天 解锁文章
9818

被折叠的 条评论
为什么被折叠?



