tableLayoutPanel如何设置边框粗细和颜色

qingtianzhuren 2011-07-09 04:00:04
并不是最外围的四个,全部,需要重写吗?
...全文
7017 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
蝶恋花雨 2011-07-11
  • 打赏
  • 举报
回复
http://msdn.microsoft.com/zh-cn/library/system.windows.forms.tablelayoutpanel.cellpaint.aspx
蝶恋花雨 2011-07-11
  • 打赏
  • 举报
回复
在tableLayoutPanel控件的CellPaint事件里重新绘制,代码如下:

            // 重绘
Pen pp = new Pen(Color.Red);
e.Graphics.DrawRectangle(pp, e.CellBounds.X, e.CellBounds.Y, e.CellBounds.X + e.CellBounds.Width - 1, e.CellBounds.Y + e.CellBounds.Height - 1);
bdmh 2011-07-11
  • 打赏
  • 举报
回复
你只能自画了
wahahagaga 2011-07-11
  • 打赏
  • 举报
回复
在tableLayoutPanel控件的CellPaint事件里重新绘制,代码如下:

   private void tableLayoutPanel1_CellPaint(object sender, TableLayoutCellPaintEventArgs e) { // 单元格重绘 Pen pp = new Pen(Color.Red); e.Graphics.DrawRectangle(pp, e.CellBounds.X, e.CellBounds.Y, e.CellBounds.X + e.CellBounds.Width - 1, e.CellBounds.Y + e.CellBounds.Height - 1); }



111,120

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Creator Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧