Winform控件开发(20)——TableLayoutPanel(史上最全)更新中

前言:
TableLayoutPane主要用于对父控件进行分隔,按照指定的行数、列数进行分隔,也可以对每行的宽度大小进行设置,对每列的宽度进行设置。
Winform控件开发(20)——TableLayoutPanel(史上最全)更新中_第1张图片

一、属性

二、事件

1、自定义TableLayoutPanel
class MyTableLayoutPanel:TableLayoutPanel
{
protected override void OnCellPaint(TableLayoutCellPaintEventArgs e)
{
base.OnCellPaint(e);

        Control c = this.GetControlFromPosition(e.Column, e.Row);

        if (c != null)
        {
            Graphics g = e.Graphics;

            g.DrawRectangle(
                Pens.Red,
                e.CellBounds.Location.X + 1,
                e.CellBounds.Location.Y + 1,
                e.CellBounds.Width - 2, e.CellBounds.Height - 2);

            g.FillRectangle(
                Brushes.Blue,
                e.CellBounds.Location.X + 1,
                e.CellBounds.Location.Y + 1,
      

你可能感兴趣的:(winform控件从入门到精通,javascript,开发语言,ecmascript)